OFFSET
1,1
COMMENTS
89 is the first number that will not reach zero under iteration of f(x) = reverse(x) - maxdigit(x), since 98-9=89. It is conjectured that 0 and 89 are the only fixed points of f.
EXAMPLE
a(5)=3126 because 3126 -> 6207 -> 7019 -> 9098 -> 8900 -> 89.
MATHEMATICA
nxt[n_]:=Module[{ridn=Reverse[IntegerDigits[n]]}, FromDigits[ridn]- Max[ ridn]]; Transpose[Select[Table[{i, NestWhile[nxt, i, !MemberQ[{0, 89}, #]&]}, {i, 30000}], #[[2]]==89&]][[1]] (* Harvey P. Dale, Dec 21 2011 *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Jason Earls, Aug 01 2004
EXTENSIONS
Corrected by Harvey P. Dale, Dec 21 2011
STATUS
approved