OFFSET
1,2
COMMENTS
Conjecture: 1 is reachable for every n. Verified for n up to 10^6. - Ivan N. Ianakiev, Jan 10 2016
Proof: For every n > 59, A267238(n) < n. - Ivan N. Ianakiev, Jan 15 2016
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
Ivan N. Ianakiev, Jan 09 2016
STATUS
approved