OFFSET
1,2
EXAMPLE
a(5)=15 because 15 -> 46 -> 58 -> 77 -> 70 -> 0 takes five steps to reach zero.
MATHEMATICA
g[n_] := Block[{id = IntegerDigits[n]}, ie = FromDigits[ Reverse[id]] - Union[id][[ -1]]; If[ie == 89, 0, ie]]; h[n_] := Length[NestWhileList[g, n, UnsameQ, All]] - 2; Do[ a = h[n]; If[a < 51 && t[[a]] == 0, t[[a]] = n], {n, 10^6}] (* Robert G. Wilson v, Aug 13 2004 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Jason Earls, Aug 01 2004
EXTENSIONS
More terms from Robert G. Wilson v, Aug 13 2004
STATUS
approved