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.

A061563 Start with n; add to itself with digits reversed; if palindrome, stop; otherwise repeat; a(n) gives palindrome at which it stops, or -1 if no palindrome is ever reached.

This page as a plain text file.
%I A061563 #28 Mar 26 2025 19:12:11
%S A061563 0,2,4,6,8,11,33,55,77,99,11,22,33,44,55,66,77,88,99,121,22,33,44,55,
%T A061563 66,77,88,99,121,121,33,44,55,66,77,88,99,121,121,363,44,55,66,77,88,
%U A061563 99,121,121,363,484,55,66,77,88,99,121,121,363,484,1111,66,77,88,99,121
%N A061563 Start with n; add to itself with digits reversed; if palindrome, stop; otherwise repeat; a(n) gives palindrome at which it stops, or -1 if no palindrome is ever reached.
%C A061563 It is believed that n = 196 is the smallest integer which never reaches a palindrome.
%H A061563 T. D. Noe, <a href="/A061563/b061563.txt">Table of n, a(n) for n=0..195</a>
%H A061563 <a href="/index/Res#RAA">Index entries for sequences related to Reverse and Add!</a>
%e A061563 19 -> 19 + 91 = 110 -> 110 + 011 = 121, so a(19) = 121.
%t A061563 tol = 1000; r[n_] := FromDigits[Reverse[IntegerDigits[n]]]; palQ[n_] := n == r[n]; ar[n_] := n + r[n]; Table[k = 0; If[palQ[n], n = ar[n]; k = 1]; While[! palQ[n] && k < tol, n = ar[n]; k++]; If[k == tol, n = -1]; n, {n, 0, 64}] (* _Jayanta Basu_, Jul 11 2013 *)
%t A061563 Table[Module[{k=n+IntegerReverse[n]},While[k!=IntegerReverse[k],k=k+IntegerReverse[k]];k],{n,0,70}] (* The program uses the IntegerReverse function from Mathematica version 10 *) (* _Harvey P. Dale_, Jul 19 2016 *)
%o A061563 (ARIBAS) var st: stack; test: boolean; end; for k := 0 to 60 do n := k; test := true; while test do n := n + int_reverse(n); test := n <> int_reverse(n); end; stack_push(st,n); end; stack2array(st);
%Y A061563 Cf. A033865. A016016 (number of steps), A023109, A006950, A023108.
%K A061563 nonn,base,easy,nice,look
%O A061563 0,2
%A A061563 _N. J. A. Sloane_, May 18 2001
%E A061563 Corrected and extended by _Klaus Brockhaus_, May 20 2001
%E A061563 More terms from _Ray Chandler_, Jul 25 2003