OFFSET
0,11
LINKS
Felix Fröhlich, Table of n, a(n) for n = 0..10000
EXAMPLE
For n = 11: Successively increasing the digits of n yields the sequence s(t) (starting with t = 0): 11, 22, 33, 44, 55, 66, 77, 88, 99, 0. s(9) = 0, so a(11) = 9.
For n = 15: The sequence s(t) (again starting with t = 0): 15, 26, 37, 48, 59, 60, 71, 82, 93, 4. s(9) = 4, so a(15) = 9.
PROG
(PARI) eva(n) = subst(Pol(n), x, 10)
increasedigits(n) = my(d=digits(n)); for(k=1, #d, d[k]++; if(d[k]==10, d[k]=0)); eva(d)
a(n) = my(x=n, i=0); while(#Str(x) > 1, x=increasedigits(x); i++); i
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Felix Fröhlich, Mar 12 2016
STATUS
approved