OFFSET
1,2
COMMENTS
EXAMPLE
Starting with 74, 11 'Reverse and Add' steps are needed to reach a palindrome; starting with n < 74, less (at most 5) steps are needed.
MATHEMATICA
limit = 10^4; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
best = -1; Select[Range[0, 100000], (np = #; i = 0;
While[np != IntegerReverse[np, 2] && i < limit,
np = np + IntegerReverse[np, 2]; i++];
If[i >= limit, False, If[i > best, best = i; True]]) &] (* Robert Price, Oct 14 2019 *)
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Klaus Brockhaus, Dec 08 2001
EXTENSIONS
Offset corrected and a(19)-a(23) from A.H.M. Smeets, Apr 30 2022
STATUS
approved