A066144 In base 2: n sets a new record for the number of 'Reverse and Add' steps needed to reach a palindrome starting with n.
0, 2, 11, 19, 20, 74, 398, 779, 1062, 2329, 4189, 4280, 11278, 19962, 98318, 135137, 1051360, 1592930, 69226926, 4295054186, 4446008678, 17187271449, 18123849698
Offset: 1
Examples
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.
Crossrefs
Programs
-
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 *)
Extensions
Offset corrected and a(19)-a(23) from A.H.M. Smeets, Apr 30 2022
Comments