A065199 Record high values in A033665, ignoring those numbers that are believed never to reach a palindrome.
0, 1, 2, 3, 4, 6, 24, 30, 53, 54, 55, 58, 64, 78, 79, 80, 82, 96, 97, 98, 109, 112, 113, 131, 135, 147, 149, 186, 187, 188, 198, 201, 232, 233, 236, 259, 260, 261
Offset: 1
Examples
Starting with 89, 24 'Reverse and Add' steps are needed to reach a palindrome; starting with n < 89, at most 6 steps are needed. For n = A065198(21) = 1005499526, a(21) = 109 "reverse and add" operations are needed to reach a palindrome; for all smaller n, at most 98 steps are needed. For n = A065198(31) ~ 10^14, a(31) = 198 "reverse and add" operations are needed to reach a palindrome; for all smaller n, at most 188 steps are needed. For n = A065198(36) ~ 10^18, a(36) = 259 "reverse and add" operations are needed to reach a palindrome; for all smaller n, at most 236 steps are needed.
Links
- Jason Doucette, World records
- Index entries for sequences related to Reverse and Add!
Programs
-
Mathematica
limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *) best = -1; lst = {}; For[n = 0, n <= 100000, n++, np = n; i = 0; While[np != IntegerReverse[np] && i < limit, np = np + IntegerReverse[np]; i++]; If[i < limit && i > best, best = i; AppendTo[lst, i]]]; lst (* Robert Price, Oct 14 2019 *)
-
PARI
my(m, M=-1); for(n=0, oo, (M
A033665(n, M+39))&&print1(M=m", ")) \\ For illustration; becomes very slow for terms > 70, even with the "custom" search limit as optional 2nd arg to A033665. - M. F. Hasler, Feb 16 2020
Formula
Extensions
Terms a(17) to a(21) from Sascha Kurz, Dec 05 2001
Terms a(22) onwards were taken from Jason Doucette, World records. - Klaus Brockhaus, Sep 24 2003
Terms a(36) to a(38) were taken from Jason Doucette, World records and added by A.H.M. Smeets, Feb 10 2019
Edited by N. J. A. Sloane, Jul 16 2021
Comments