OFFSET
0,5
COMMENTS
EXAMPLE
For n = 22: There exist 4 positive integers k < 22 such that 22 occurs in the Reverse-and-Add trajectory of k, namely 5, 10, 11 and 20, so a(22) = 4.
MATHEMATICA
Block[{nn = 85, s}, s = Array[Union@ NestWhileList[# + IntegerReverse@ # &, #, # < nn &, 1, nn] &, nn]; Array[Count[Take[s, # - 1], #, 2] &, nn + 1, 0]] (* Michael De Vlieger, Feb 01 2018 *)
PROG
(PARI) a(n) = my(i=0); for(k=1, n-1, my(x=k); while(x < n, x=x+eval(concat(Vecrev(Str(x))))); if(x==n, i++)); i
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Felix Fröhlich, Jan 30 2018
STATUS
approved