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.

Showing 1-10 of 34 results. Next

A023108 Positive integers which apparently never result in a palindrome under repeated applications of the function A056964(x) = x + (x with digits reversed).

Original entry on oeis.org

196, 295, 394, 493, 592, 689, 691, 788, 790, 879, 887, 978, 986, 1495, 1497, 1585, 1587, 1675, 1677, 1765, 1767, 1855, 1857, 1945, 1947, 1997, 2494, 2496, 2584, 2586, 2674, 2676, 2764, 2766, 2854, 2856, 2944, 2946, 2996, 3493, 3495, 3583, 3585, 3673, 3675
Offset: 1

Views

Author

Keywords

Comments

196 is conjectured to be smallest initial term which does not lead to a palindrome. John Walker, Tim Irvin and others have extended this to millions of digits without finding one (see A006960).
Also called Lychrel numbers, though the definition of "Lychrel number" varies: Purists only call the "seeds" or "root numbers" Lychrel; the "related" or "extra" numbers (arising in the former's orbit) have been coined "Kin numbers" by Koji Yamashita. There are only 2 "root" Lychrels below 1000 and 3 more below 10000, cf. A088753. - M. F. Hasler, Dec 04 2007
Question: when do numbers in this sequence start to outnumber numbers that are not in the sequence? - J. Lowell, May 15 2014
Answer: according to Doucette's site, 10-digit numbers have 49.61% of Lychrels. So beyond 10 digits, Lychrels start to outnumber non-Lychrels. - Dmitry Kamenetsky, Oct 12 2015
From the current definition it is unclear whether palindromes are excluded from this sequence, cf. A088753 vs A063048. 9999 would be the first palindromic term that will never result in a palindrome when the Reverse-then-add function A056964 is repeatedly applied. - M. F. Hasler, Apr 13 2019

Examples

			From _M. F. Hasler_, Feb 16 2020: (Start)
Under the "add reverse" operation, we have:
196 (+ 691) -> 887 (+ 788) -> 1675 (+ 5761) -> 7436 (+ 6347) -> 13783 (+ 38731) -> etc. which apparently never leads to a palindrome.
Similar for 295 (+ 592) -> 887, 394 (+ 493) -> 887, 790 (+ 097) -> 887 and 689 (+ 986) -> 1675, which all merge immediately into the above sequence, and also for the reverse of any of the numbers occurring in these sequences: 493, 592, 691, 788, ...
879 (+ 978) -> 1857 -> 9438 -> 17787 -> 96558 is the only other "root" Lychrel below 1000 which yields a sequence distinct from that of 196. (End)
		

References

  • Daniel Lignon, Dictionnaire de (presque) tous les nombres entiers, Ellipses, Paris, 2012, 702 pages. See Entry 196.

Crossrefs

Cf. A056964 ("reverse and add" operation on which this is based).

Programs

  • Mathematica
    With[{lim = 10^3}, Select[Range@ 4000, Length@ NestWhileList[# + IntegerReverse@ # &, #, ! PalindromeQ@ # &, 1, lim] == lim + 1 &]] (* Michael De Vlieger, Dec 23 2017 *)
  • PARI
    select( {is_A023108(n, L=exponent(n+1)*5)=while(L--&& n*2!=n+=A004086(n),);!L}, [1..3999]) \\ with {A004086(n)=fromdigits(Vecrev(digits(n)))}; default value for search limit L chosen according to known records A065199 and indices A065198. - M. F. Hasler, Apr 13 2019, edited Feb 16 2020

Extensions

Edited by M. F. Hasler, Dec 04 2007

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

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Oct 20 2001

Keywords

Comments

Records for the number of 'Reverse and Add' steps needed to reach a palindrome.
A065198 gives the corresponding starting points.

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.
		

Crossrefs

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, (MA033665(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

a(n) = A033665(A065198(n)). - M. F. Hasler, Feb 16 2020

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

A033665 Number of 'Reverse and Add' steps needed to reach a palindrome starting at n, or -1 if n never reaches a palindrome.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 0, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 0, 1, 2, 2, 3, 1, 1, 1, 1, 2, 1, 0, 2, 3, 4, 1, 1, 1, 2, 1, 2, 2, 0, 4, 6, 1, 1, 2, 1, 2, 2, 3, 4, 0, 24, 1, 2, 1, 2, 2, 3, 4, 6, 24, 0, 1, 0, 1, 1
Offset: 0

Views

Author

Keywords

Comments

Palindromes themselves are not 'Reverse and Add!'ed, so they yield a zero!
Numbers n that may have a(n) = -1 (i.e., potential Lychrel numbers) appear in A023108. - Michael De Vlieger, Jan 11 2018
Record indices and values are given in A065198 and A065199. - M. F. Hasler, Feb 16 2020

Examples

			19 -> 19+91 = 110 -> 110+011 = 121 = palindrome, took 2 steps, so a(19)=2.
n = 89 needs 24 steps to end up with the palindrome 8813200023188. See A240510. - _Wolfdieter Lang_, Jan 12 2018
		

References

  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers Penguin Books, 1987, pp. 142-143.

Crossrefs

Equals A030547(n) - 1.
Cf. A065198, A065199 (record indices & values).

Programs

  • Mathematica
    rev[n_]:=FromDigits[Reverse[IntegerDigits[n]]];radd[n_]:=n+rev[n];
    pal[n_]:=If[n==rev[n],True,False];
    raddN[n_]:=Length[NestWhileList[radd[#]&,n,pal[#]==False&]]-1;
    raddN/@Range[0,195] (* Ivan N. Ianakiev, Aug 31 2015 *)
    With[{nn = 10^3}, Array[-1 + Length@ NestWhileList[# + IntegerReverse@ # &, #, !PalindromeQ@ # &, 1, nn] /. k_ /; k == nn -> -1 &, 200]] (* Michael De Vlieger, Jan 11 2018 *)
  • PARI
    rev(n)={d=digits(n);p="";for(i=1,#d,p=concat(Str(d[i]),p));return(eval(p))}
    a(n)=if(n==rev(n),return(0));for(k=1,10^3,i=n+rev(n);if(rev(i)==i,return(k));n=i)
    n=0;while(n<100,print1(a(n),", ");n++) \\ Derek Orr, Jul 28 2014
    
  • PARI
    A033665(n,LIM=333)={-!for(i=0,LIM,my(r=A004086(n)); n==r&&return(i); n+=r)} \\ with {A004086(n)=fromdigits(Vecrev(digits(n)))}. The second optional arg is a search limit that could be taken smaller up to very large n, e.g., 99 for n < 10^9, 200 for n < 10^14, 250 for n < 10^18: see A065199 for the records and A065198 for the n's. - M. F. Hasler, Apr 13 2019, edited Feb 16 2020
    
  • Python
    A033665 = lambda n, LIM=333: next((i for i in range(LIM) if is_A002113(n) or not(n := A004086(n)+n)), -1) # The second, optional argument is a search limit, see above. - M. F. Hasler, May 23 2024

Extensions

More terms from Patrick De Geest, Jun 15 1998
I truncated the b-file at n=195, since the value of a(196) is not presently known (cf. A006960). The old b-files are now a-files. - N. J. A. Sloane, May 09 2015

A016016 Number of iterations of Reverse and Add which lead to a palindrome, or -1 if no palindrome is ever reached.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 3, 1, 1, 1, 1, 2, 1, 2, 2, 3, 4, 1, 1, 1, 2, 1, 2, 2, 3, 4, 6, 1, 1, 2, 1, 2, 2, 3, 4, 6, 24, 1, 2, 1, 2, 2, 3, 4, 6, 24
Offset: 1

Views

Author

Keywords

Comments

A first 'Reverse and Add' operation is always made, even if the starting value n is already a palindrome, in contrast to the variant A033665.
It is conjectured that a(196) = -1, see A023108.
Because A061563 has offset 0 one should add a(0) = 1 here. - Wolfdieter Lang, Jan 12 2018
Record indices and values beyond a(1) = 1 and a(5) = 2 are given in A065198 and A065199: These refer to the variant A033665 (main entry with more up-to-date references), as can be seen from A065199(1..3) = (0, 1, 2) for A065198(1..3) = (0, 10, 19). But all larger records correspond to a non-palindromic index n, in which case a(n) = A033665(n). - M. F. Hasler, Feb 16 2020

Examples

			6 -> 6 + 6 = 12 -> 12 + 21 = 33 is palindromic, took 2 steps so a(6)=2.
n = 89 needs 24 steps to end up with the palindrome 8813200023188. See A240510. - _Wolfdieter Lang_, Jan 12 2018
		

Crossrefs

Programs

  • Mathematica
    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, k = -1]; k, {n, 98}] (* Jayanta Basu, Jul 11 2013 *)
    With[{nn = 10^3}, Array[-1 + Length@ NestWhileList[# + IntegerReverse@ # &, #, ! PalindromeQ@ # &, {2, 1}, 10^3] /. k_ /; k == nn -> -1 &, 200, 0]] (* Michael De Vlieger, Jan 11 2018 *)
  • PARI
    a(n) = my(x=n, i=0); while(1, x=x+eval(concat(Vecrev(Str(x)))); i++; if(x==eval(concat(Vecrev(Str(x)))), return(i))) \\ Felix Fröhlich, Jan 12 2018
    
  • PARI
    A016016(n, LIM=exponent(n+1)*5)={-!for(i=0, LIM, my(r=A004086(n)); n==r&&i&&return(i); n+=r)} \\ with {A004086(n)=fromdigits(Vecrev(digits(n)))}. The second optional arg is a search limit, with default value chosen according to known records A065199 and indices A065198. - M. F. Hasler, Feb 16 2020

A070743 n sets a new record for the index of the (presumably) last palindrome in the 'Reverse and Add' trajectory of n.

Original entry on oeis.org

1, 3, 5, 122, 160, 190, 739, 10000, 10058, 10151, 1003346, 1304392, 1702190
Offset: 1

Views

Author

Klaus Brockhaus, May 03 2002

Keywords

Comments

A070744 gives the corresponding records.

Examples

			678736545637876 is the 36th term and (presumably) the last palindrome in the trajectory of 5; for k < 5 the last palindrome has an index < 36 in the trajectory of k (cf. A070742), so 5 is in the sequence.
		

Crossrefs

Extensions

Offset corrected by Sean A. Irvine, Jun 11 2024

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

Original entry on oeis.org

89, 98, 16991, 17981, 18971, 19961, 26990, 27980, 28970, 29960, 50169, 51159, 52149, 53139, 54129, 55119, 56109, 56199, 57189, 58179, 59169, 60168, 60649, 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
Offset: 1

Views

Author

Klaus Brockhaus, Oct 30 2001

Keywords

Comments

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.

Crossrefs

Programs

  • 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);
  • Mathematica
    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 *)
    lenQ[n_]:= Length[NestWhileList[# + FromDigits[Reverse[IntegerDigits[#]]]&, n, #!= FromDigits[Reverse[IntegerDigits[#]]]&, 1, 25]] == 25; Select[Range[100000],lenQ] (* Vincenzo Librandi, Sep 24 2013 *)

Extensions

Additional terms from Harvey P. Dale, Nov 26 2010
Changed offset from 0 to 1 by Vincenzo Librandi, Sep 24 2013

A065320 53 'Reverse and Add' steps are needed to reach a palindrome.

Original entry on oeis.org

10677, 11667, 12657, 13647, 14637, 15627, 16617, 17607, 20676, 21666, 22656, 23646, 24636, 25626, 26616, 27606, 30675, 31665, 32655, 33645, 34635, 35625, 36615, 37605, 40674, 41664, 42654, 43644, 44634, 45624, 46614, 47604, 50673
Offset: 1

Views

Author

Klaus Brockhaus, Oct 30 2001

Keywords

Comments

The number of steps starts at 0, so palindromes (cf. A002113) are excluded. 53 is a record (cf. A065199) of the number of 'Reverse and Add' steps needed to reach a palindrome.
The first term not congruent 84 mod 99 is a(64) = 109902, thereafter the residues show no obvious pattern. - Klaus Brockhaus, Jul 14 2003

Crossrefs

Programs

  • Mathematica
    lenQ[n_]:= Length[NestWhileList[# + FromDigits[Reverse[IntegerDigits[#]]]&, n, #! = FromDigits[Reverse[IntegerDigits[#]]]&, 1, 54]] == 54; Select[Range[10000], lenQ] (* Vincenzo Librandi, Sep 24 2013 *)

Extensions

Changed offset from 0 to 1 by Vincenzo Librandi, Sep 24 2013

A065321 Numbers n such that 54 'Reverse and Add' steps are needed to reach a palindrome.

Original entry on oeis.org

10833, 11823, 12813, 13803, 20832, 21822, 22812, 23802, 30831, 31821, 32811, 33801, 40830, 41820, 42810, 43800, 1006804, 1016704, 1026604, 1027920, 1028941, 1036504, 1037820, 1038841, 1046404, 1047720, 1048741, 1048903, 1056304
Offset: 1

Views

Author

Klaus Brockhaus, Oct 30 2001

Keywords

Comments

The number of steps starts at 0, so palindromes (cf. A002113) are excluded. 54 is a record (cf. A065199) for the number of 'Reverse and Add' steps needed to reach a palindrome.

Crossrefs

A065322 55 'Reverse and Add' steps are needed to reach a palindrome.

Original entry on oeis.org

10911, 11901, 20910, 21900, 1009520, 1009601, 1019420, 1019501, 1029320, 1029401, 1039220, 1049120, 1049201, 1059020, 1059101, 1069001, 1108391, 1109510, 1118291, 1119410, 1128191, 1129310, 1138091, 1139210, 1149110
Offset: 0

Views

Author

Klaus Brockhaus, Oct 30 2001

Keywords

Comments

The number of steps starts at 0, so palindromes (cf. A002113) are excluded. 55 is a record (cf. A065199) of the number of 'Reverse and Add' steps needed to reach a palindrome.

Crossrefs

A065323 58 'Reverse and Add' steps are needed to reach a palindrome.

Original entry on oeis.org

147996, 148896, 149796, 157986, 158886, 159786, 167976, 168876, 169776, 177966, 178866, 179766, 187956, 188856, 189756, 190296, 191196, 192096, 197946, 198846, 199746, 247995, 248895, 249795, 257985, 258885, 259785, 267975, 268875, 269775
Offset: 0

Views

Author

Klaus Brockhaus, Oct 30 2001

Keywords

Comments

The number of steps starts at 0, so palindromes (cf. A002113) are excluded. 58 is a record (cf. A065199) of the number of 'Reverse and Add' steps needed to reach a palindrome.

Crossrefs

Programs

Showing 1-10 of 34 results. Next