login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A266999
Smallest number m such that A266998(m) = n.
3
1, 10, 4, 12, 6, 3, 2, 11, 5, 18, 7, 13, 9, 19, 8, 17, 115, 3789
OFFSET
0,2
COMMENTS
The next term is too large to include.
LINKS
FORMULA
A266998(a(n)) = n and A266998(m) != n for m < a(n).
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
Cf. A266998.
Sequence in context: A376972 A100844 A076587 * A166204 A364190 A329649
KEYWORD
base,more,nonn
AUTHOR
Ivan N. Ianakiev, Jan 10 2016
STATUS
approved