Post Reply 
Sum of Digits.
03-26-2016, 09:06 PM
Post: #26
RE: Sum of Digits.
(03-26-2016 08:15 PM)ggauny@live.fr Wrote:  After seeying post #20 link in french, I am as before.
I think it is very simple solution but only for you.

The solution is simple because it is just x mod 9. ;-)
(Or 9 if this yields zero).

x=156: 1+5+6 = 12. Then 1+2 = 3
156 mod 9 = 3

x=12345: 1+2+3+4+5 = 15. Then 1+5 = 6
12345 mod 9 = 6

x=987654321: 9+8+7+6+5+4+3+2+1 = 45. Then 4+5 = 9
987654321 mod 9 = 0 => result is 9

Voilà – it's as simple as that.

(03-26-2016 08:15 PM)ggauny@live.fr Wrote:  15 : 1 5 I add and it is 6.

15 mod 9 = 6

(03-26-2016 08:15 PM)ggauny@live.fr Wrote:  In 3 steps ????

Well... OK, that's a real challenge. ;-)
But it can be done in four steps.

Franz used the more correct solution 1 + (x–1) mod 9 which can be coded in four steps as well. At least on the 34s.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Sum of Digits. - ggauny@live.fr - 03-25-2016, 11:16 AM
RE: Sum of Digits. - Dieter - 03-25-2016, 01:41 PM
RE: Sum of Digits. - Didier Lachieze - 03-25-2016, 04:37 PM
RE: Sum of Digits. - ggauny@live.fr - 03-25-2016, 05:46 PM
RE: Sum of Digits. - Dieter - 03-25-2016, 06:34 PM
RE: Sum of Digits. - fhub - 03-26-2016, 01:02 PM
RE: Sum of Digits. - Dieter - 03-26-2016, 06:02 PM
RE: Sum of Digits. - fhub - 03-26-2016, 06:17 PM
RE: Sum of Digits. - BarryMead - 03-30-2016, 11:24 AM
RE: Sum of Digits. - Dieter - 03-30-2016, 12:46 PM
RE: Sum of Digits. - BarryMead - 03-30-2016, 07:54 PM
RE: Sum of Digits. - BarryMead - 03-30-2016, 11:11 AM
RE: Sum of Digits. - ggauny@live.fr - 03-25-2016, 07:44 PM
RE: Sum of Digits. - Massimo Gnerucci - 03-25-2016, 08:48 PM
RE: Sum of Digits. - ggauny@live.fr - 03-25-2016, 08:26 PM
RE: Sum of Digits. - Dieter - 03-25-2016, 08:33 PM
RE: Sum of Digits. - ggauny@live.fr - 03-25-2016, 08:37 PM
RE: Sum of Digits. - ggauny@live.fr - 03-25-2016, 08:46 PM
RE: Sum of Digits. - Dieter - 03-25-2016, 08:48 PM
RE: Sum of Digits. - ggauny@live.fr - 03-25-2016, 08:49 PM
RE: Sum of Digits. - Dieter - 03-25-2016, 08:59 PM
RE: Sum of Digits. - ggauny@live.fr - 03-26-2016, 01:17 PM
RE: Sum of Digits. - Dieter - 03-26-2016, 06:16 PM
RE: Sum of Digits. - ggauny@live.fr - 03-26-2016, 07:52 AM
RE: Sum of Digits. - ggauny@live.fr - 03-26-2016, 07:54 AM
RE: Sum of Digits. - ggauny@live.fr - 03-26-2016, 06:22 PM
RE: Sum of Digits. - Dieter - 03-26-2016, 06:27 PM
RE: Sum of Digits. - ggauny@live.fr - 03-26-2016, 08:15 PM
RE: Sum of Digits. - Dieter - 03-26-2016 09:06 PM
RE: Sum of Digits. - ggauny@live.fr - 03-26-2016, 08:18 PM
RE: Sum of Digits. - ggauny@live.fr - 03-27-2016, 07:10 AM
RE: Sum of Digits. - ggauny@live.fr - 03-29-2016, 11:34 AM
RE: Sum of Digits. - Dieter - 03-29-2016, 07:36 PM
RE: Sum of Digits. - ggauny@live.fr - 03-30-2016, 10:00 AM
RE: Sum of Digits. - Dieter - 03-30-2016, 12:42 PM
RE: Sum of Digits. - ggauny@live.fr - 03-30-2016, 10:04 AM
RE: Sum of Digits. - ggauny@live.fr - 03-30-2016, 05:37 PM
RE: Sum of Digits. - Dieter - 03-30-2016, 06:01 PM
RE: Sum of Digits. - ggauny@live.fr - 03-31-2016, 07:33 AM
RE: Sum of Digits. - Dieter - 03-31-2016, 12:50 PM



User(s) browsing this thread: 1 Guest(s)