Post Reply 
(12C) Digit Sum
05-03-2018, 10:50 AM (This post was last modified: 05-03-2018 11:47 AM by Gamo.)
Post: #1
(12C) Digit Sum
In mathematics, the digit sum of a given integer is the sum of all its digits
The digit sum of 84001 is calculated as 8+4+0+0+1 = 13
Register used R1, R2 and R3
84001 R/S > 13

Code:

01 STO 1
02   1
03   0
04 STO 3
05   /
06 FRAC
07 RCL 3
08   x
09 STO+2
10 RCL 1
11 RCL 3
12   /
13 INTG
14 STO 1
15 X=0 ?
16 GTO 18
17 GTO 01
18 RCL 2
19   0
20 STO 2
21 X<>Y


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


Messages In This Thread
(12C) Digit Sum - Gamo - 05-03-2018 10:50 AM
RE: (12C) Digit Sum - Dieter - 05-03-2018, 06:02 PM
RE: (12C) Digit Sum - Dieter - 05-04-2018, 12:11 PM
RE: (12C) Digit Sum - Gamo - 05-10-2018, 12:11 PM
RE: (12C) Digit Sum - Gamo - 01-08-2019, 04:34 AM
RE: (12C) Digit Sum - Thomas Klemm - 01-08-2019, 08:24 AM



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