login
Numbers that reach the fixed point 89 under iteration of f(x) = reverse(x) - maxdigit(x).
5

%I #7 Dec 15 2017 17:36:45

%S 89,890,998,2125,3126,5207,6207,7018,7019,8099,8900,9098,9899,9980,

%T 10151,10152,10224,12205,12259,12268,14085,14086,15095,15096,17972,

%U 18971,21250,22015,22269,23077,24005,24086,24087,25096,26963,27962

%N Numbers that reach the fixed point 89 under iteration of f(x) = reverse(x) - maxdigit(x).

%C 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.

%e a(5)=3126 because 3126 -> 6207 -> 7019 -> 9098 -> 8900 -> 89.

%t 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 *)

%Y Cf. A097153, A097154, A097156, A097157, A097158.

%K base,easy,nonn

%O 1,1

%A _Jason Earls_, Aug 01 2004

%E Corrected by Harvey P. Dale, Dec 21 2011