Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Digital-root/Potion/digital-root.potion
Normal file
17
Task/Digital-root/Potion/digital-root.potion
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
digital = (x) :
|
||||
dr = x string # Digital Root.
|
||||
ap = 0 # Additive Persistence.
|
||||
while (dr length > 1) :
|
||||
sum = 0
|
||||
dr length times (i): sum = sum + dr(i) number integer.
|
||||
dr = sum string
|
||||
ap++
|
||||
.
|
||||
(x, " has additive persistence ", ap,
|
||||
" and digital root ", dr, ";\n") join print
|
||||
.
|
||||
|
||||
digital(627615)
|
||||
digital(39390)
|
||||
digital(588225)
|
||||
digital(393900588225)
|
||||
Loading…
Add table
Add a link
Reference in a new issue