|
|
A266998
|
|
Number of iterations of the map "n -> sum of the triangular numbers whose indices are the digits of n" needed to reach 1.
|
|
2
|
|
|
0, 6, 5, 2, 8, 4, 10, 14, 12, 1, 7, 3, 11, 8, 7, 6, 15, 9, 13, 6, 3, 5, 13, 12, 10, 13, 12, 9, 14, 5, 11, 13, 4, 7, 4, 13, 8, 13, 8, 2, 8, 12, 7, 7, 11, 12, 14, 13, 7, 8, 7, 10, 4, 11, 6, 14, 8, 8, 5, 4, 6, 13, 13, 12, 14, 13, 8, 9, 14, 10
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Conjecture: 1 is reachable for every n. Verified for n up to 10^6. - Ivan N. Ianakiev, Jan 10 2016
|
|
LINKS
|
|
|
EXAMPLE
|
6 iterations are needed to start from 2 and reach 1 (2->3->6->21->4->10->1), therefore a(2) = 6.
|
|
MATHEMATICA
|
f[n_] := Total[IntegerDigits[n] * (IntegerDigits[n] + 1)/2];
g[n_] := NestWhileList[f[#] &, n, # > 1 &]; h[n_] := Length[g[n]] - 1;
h/@Range@100
|
|
PROG
|
(PARI) strd(n) = {my(d = digits(n)); sum(k=1, #d, d[k]*(d[k]+1)/2); }
a(n) = {my(nb=0); while(n != 1, n = strd(n); nb++; ); nb; } \\ Michel Marcus, Jan 12 2016
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|