cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A065318 24 'Reverse and Add' steps are needed to reach a palindrome.

This page as a plain text file.
%I A065318 #23 Feb 25 2025 11:03:25
%S A065318 89,98,16991,17981,18971,19961,26990,27980,28970,29960,50169,51159,
%T A065318 52149,53139,54129,55119,56109,56199,57189,58179,59169,60168,60649,
%U A065318 61158,61639,62148,62629,63138,63619,64128,64609,64699,65118,65689,66108,66198,66679,67188,67669,68178,68659,69168,69649,70167,70648,71157,71638,72147,72628,73618,74127,74608,74698,75117,75688,76107,76197,76678,77187,77668,78177,78658,79167,79648,80166,80339,80499
%N A065318 24 'Reverse and Add' steps are needed to reach a palindrome.
%C A065318 The number of steps starts at 0, so palindromes (cf. A002113) are excluded. 24 is a record (cf. A065199) of the number of 'Reverse and Add' steps needed to reach a palindrome.
%H A065318 Vincenzo Librandi, <a href="/A065318/b065318.txt">Table of n, a(n) for n = 1..500</a>
%H A065318 <a href="/index/Res#RAA">Index entries for sequences related to Reverse and Add!</a>
%t A065318 palQ[n_]:=Module[{idn=IntegerDigits[n]},idn==Reverse[idn]]; With[{tstx =Join[Table[False,{24}],{True}]},tstQ[n_]:=palQ/@NestList[#+FromDigits[ Reverse[IntegerDigits[#]]]&,n,24]==tstx]; Select[Range[100000],tstQ] (* _Harvey P. Dale_, Nov 26 2010, Sep 30 2011 *)
%t A065318 lenQ[n_]:= Length[NestWhileList[# + FromDigits[Reverse[IntegerDigits[#]]]&, n, #!= FromDigits[Reverse[IntegerDigits[#]]]&, 1, 25]] == 25; Select[Range[100000],lenQ] (* _Vincenzo Librandi_, Sep 24 2013 *)
%o A065318 (ARIBAS) function revaddi_steps(k,start,up: integer); var n,m,steps,rev: integer; begin for n := start to up do m := n; rev := int_reverse(m); steps := 0; while steps < k and m <> rev do m := m + rev; rev := int_reverse(m); inc(steps); end; if steps = k and m = rev then write(n," "); end; end; end; revaddi_steps(24,0,66200);
%Y A065318 Cf. A002113, A065198, A065199.
%K A065318 base,nonn
%O A065318 1,1
%A A065318 _Klaus Brockhaus_, Oct 30 2001
%E A065318 Additional terms from _Harvey P. Dale_, Nov 26 2010
%E A065318 Changed offset from 0 to 1 by _Vincenzo Librandi_, Sep 24 2013