langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
3
Task/Digital-root/Mathematica/digital-root.math
Normal file
3
Task/Digital-root/Mathematica/digital-root.math
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
seq[n_, b_] := FixedPointList[Total[IntegerDigits[#, b]] &, n];
|
||||
root[n_Integer, base_: 10] := If[base == 10, #, BaseForm[#, base]] &[Last[seq[n, base]]]
|
||||
persistance[n_Integer, base_: 10] := Length[seq[n, base]] - 2;
|
||||
Loading…
Add table
Add a link
Reference in a new issue