login
Record high values in A033665, ignoring those numbers that are believed never to reach a palindrome.
34

%I #37 Jul 16 2021 05:06:47

%S 0,1,2,3,4,6,24,30,53,54,55,58,64,78,79,80,82,96,97,98,109,112,113,

%T 131,135,147,149,186,187,188,198,201,232,233,236,259,260,261

%N Record high values in A033665, ignoring those numbers that are believed never to reach a palindrome.

%C Records for the number of 'Reverse and Add' steps needed to reach a palindrome.

%C A065198 gives the corresponding starting points.

%H Jason Doucette, <a href="http://www.jasondoucette.com/worldrecords.html">World records</a>

%H <a href="/index/Res#RAA">Index entries for sequences related to Reverse and Add!</a>

%F a(n) = A033665(A065198(n)). - _M. F. Hasler_, Feb 16 2020

%e Starting with 89, 24 'Reverse and Add' steps are needed to reach a palindrome; starting with n < 89, at most 6 steps are needed.

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

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

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

%t limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *)

%t best = -1; lst = {};

%t For[n = 0, n <= 100000, n++,

%t np = n; i = 0;

%t While[np != IntegerReverse[np] && i < limit,

%t np = np + IntegerReverse[np]; i++];

%t If[i < limit && i > best, best = i; AppendTo[lst, i]]]; lst (* _Robert Price_, Oct 14 2019 *)

%o (PARI) my(m, M=-1); for(n=0, oo, (M<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

%Y Cf. A033665, A033865, A023109, A065198.

%K base,nonn,hard

%O 1,3

%A _Klaus Brockhaus_, Oct 20 2001

%E Terms a(17) to a(21) from _Sascha Kurz_, Dec 05 2001

%E Terms a(22) onwards were taken from Jason Doucette, World records. - _Klaus Brockhaus_, Sep 24 2003

%E Terms a(36) to a(38) were taken from Jason Doucette, World records and added by _A.H.M. Smeets_, Feb 10 2019

%E Edited by _N. J. A. Sloane_, Jul 16 2021