OFFSET
0,2
COMMENTS
The next term is too large to include.
LINKS
Michel Marcus, Table of n, a(n) for n = 0..17
MATHEMATICA
a266999={};
f[n_]:=Total[IntegerDigits[n]*(IntegerDigits[n]+1)/2];
g[n_]:=NestWhileList[f[#]&, n, #>1&];
h[n_]:=Length[g[n]]-1;
a266998=h/@Range[10^6];
Do[AppendTo[a266999, First[Position[a266998, m]]], {m, 0, Max[a266998]}];
a266999//Flatten
PROG
(PARI) strd(n) = {my(d = digits(n)); sum(k=1, #d, d[k]*(d[k]+1)/2); }
nbi(n) = {my(nb=0); while(n != 1, n = strd(n); nb++; ); nb; }
a(n) = {my(m = 1); while(nbi(m) != n, m++); m; } \\ Michel Marcus, Jan 12 2016
CROSSREFS
KEYWORD
base,more,nonn
AUTHOR
Ivan N. Ianakiev, Jan 10 2016
STATUS
approved