Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,28 @@
REM Digital root
DATA 1&, 14&, 267&, 8128&, 39390&, 588225&, 627615&
FOR I = 0 TO 6
READ A&
N& = A&
Base = 10
GOSUB CalcDRootAndPers:
PRINT A&;
PRINT Pers;
PRINT Root
NEXT I
END
CalcDRootAndPers:
REM Results: Root - digital root; Pers - persistance
Pers = 0
WHILE N& >= Base
S = 0
Loop:
NModBase& = N& MOD Base
S = S + NModBase&
N& = N& / Base
IF N& > 0 THEN Loop:
Pers = Pers + 1
N& = S
WEND
Root = N&
RETURN