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.

Previous Showing 11-20 of 70 results. Next

A001127 Trajectory of 1 under map x->x + (x-with-digits-reversed).

Original entry on oeis.org

1, 2, 4, 8, 16, 77, 154, 605, 1111, 2222, 4444, 8888, 17776, 85547, 160105, 661166, 1322332, 3654563, 7309126, 13528163, 49710694, 99312488, 187733887, 976071668, 1842242347, 9274664828, 17559329557, 93151725128, 175304440267, 937348843838, 1775697687577
Offset: 0

Views

Author

N. J. A. Sloane, Jun 05 2002

Keywords

Comments

Normally one stops as soon as a palindrome is reached.
A Reverse and Add! sequence.
Trajectories of 25, 34, 43, 52, 59, 61, 68, 70, 86, 95, ..., merge into this sequence. - Robert G. Wilson v, Dec 16 2005

Crossrefs

Programs

  • Haskell
    a001127 n = a001127_list !! n
    a001127_list = iterate a056964 1 -- Reinhard Zumkeller, Sep 22 2011
  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, (h-> h+ (s->
          parse(cat(s[-i]$i=1..length(s))))(""||h))(a(n-1)))
        end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Jun 18 2014
  • Mathematica
    NestList[ # + FromDigits@Reverse@IntegerDigits@# &, 1, 30] (* Robert G. Wilson v, Dec 16 2005 *)
    NestList[#+IntegerReverse[#]&,1,30] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 19 2019 *)

A065001 a(n) = (presumed) number of palindromes in the 'Reverse and Add!' trajectory of n, or -1 if this number is not finite.

Original entry on oeis.org

11, 10, 8, 9, 10, 7, 6, 8, 4, 9, 9, 6, 7, 5, 5, 7, 6, 3, 4, 8, 6, 8, 5, 5, 7, 6, 3, 4, 4, 6, 7, 5, 6, 7, 6, 3, 4, 4, 4, 7, 5, 5, 7, 7, 3, 4, 4, 4, 2, 5, 5, 7, 6, 3, 5, 4, 4, 2, 6, 5, 7, 6, 3, 4, 4, 5, 2, 6, 3, 7, 6, 3, 4, 4, 4, 2, 7, 3, 5, 6, 3, 4, 4, 4, 2, 6, 3, 6, 1, 3, 4, 4, 4, 2, 6, 3, 5, 1, 3, 8, 8, 6, 6
Offset: 1

Views

Author

Klaus Brockhaus, Nov 01 2001

Keywords

Comments

Presumably a(196) = 0 (see A016016). Conjecture: There is no n > 0 such that the trajectory of n contains an infinite number of palindromes; the trajectory of n eventually leads to a term in the trajectory of some integer k which belongs to sequence A063048, i.e. whose trajectory (presumably) never leads to a palindrome.

Examples

			8, 77, 1111, 2222, 4444, 8888, 661166, 3654563 are the eight palindromes in the trajectory of 8 and 3654563 + 3654563 = 7309126 is the sixth term in the trajectory of 10577 (see A063433) which (presumably) never leads to a palindrome (see A063048), so a(8) = 8.
		

Crossrefs

Programs

  • ARIBAS
    maxarg := 120; stop := 500; for k := 1 to maxarg do n := k; count := 0; c := 0; while c < stop do if n = int_reverse(n) then inc(count); c := 0; end; inc(c); n := n + int_reverse(n); end; write(count," " ); end;

A077594 Smallest number whose Reverse and Add! trajectory (presumably) contains exactly n palindromes, or -1 if there is no such number.

Original entry on oeis.org

196, 89, 49, 18, 9, 14, 7, 6, 3, 4, 2, 1, 10000, -1, -1, -1, -1, -1, -1, -1, -1
Offset: 0

Views

Author

Klaus Brockhaus, Nov 08 2002

Keywords

Comments

Conjecture 1: For each k > 0 the trajectory of k eventually leads to a term in the trajectory of some j which belongs to A063048, i.e. whose trajectory (presumably) never leads to a palindrome. Conjecture 2: There is no k > 0 such that the trajectory of k contains more than twelve palindromes, i.e. a(n) = -1 for n > 12.

Examples

			a(9) = 4 since the trajectory of 4 contains the nine palindromes 4, 8, 77, 1111, 2222, 4444, 8888, 661166, 3654563 and at 7309126 joins the trajectory of 10577 = A063048(6) and no m < 4 contains exactly nine palindromes.
		

Crossrefs

A066059 Integers such that the 'Reverse and Add!' algorithm in base 2 (cf. A062128) does not lead to a palindrome.

Original entry on oeis.org

22, 26, 28, 35, 37, 41, 46, 47, 49, 60, 61, 67, 75, 77, 78, 84, 86, 89, 90, 94, 95, 97, 105, 106, 108, 110, 116, 120, 122, 124, 125, 131, 135, 139, 141, 147, 149, 152, 155, 157, 158, 163, 164, 166, 169, 172, 174, 177, 180, 182, 185, 186, 190, 191, 193, 197, 199
Offset: 1

Views

Author

Klaus Brockhaus, Dec 04 2001

Keywords

Comments

The analog of A023108 in base 2.
It seems that for all these numbers it can be proven that they never reach a palindrome. For this it is sufficient to prove this for all seeds as given in A075252. As observed, for all numbers in A075252, lim_{n -> inf} t(n+1)/t(n) is 1 or 2 (1 for even n, 2 for odd n or reverse); i.e., lim_{n -> inf} t(n+2)/t(n) = 2, t(n) being the n-th term of the trajectory. - A.H.M. Smeets, Feb 10 2019

Crossrefs

Programs

  • ARIBAS
    : For function b2reverse see A066057; function a066059(mx,stop: integer); var k,c,m,rev: integer; begin for k := 1 to mx do c := 0; m := k; rev := b2reverse(m); while m <> rev and c < stop do inc(c); m := m + rev; rev := b2reverse(m); end; if c >= stop then write(k," "); end; end; end; a066059(210,300).
  • Mathematica
    limit = 10^4; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    Select[Range[200],
    Length@NestWhileList[# + IntegerReverse[#, 2] &, #, # !=
    IntegerReverse[#, 2]  &, 1, limit] == limit + 1 &] (* Robert Price, Oct 14 2019 *)

A063049 Integers n > 196 such that the 'Reverse and Add!' trajectory of n joins the trajectory of 196.

Original entry on oeis.org

295, 394, 493, 592, 689, 691, 788, 790, 887, 986, 1495, 1585, 1675, 1765, 1855, 1945, 2494, 2584, 2674, 2764, 2854, 2944, 3493, 3583, 3673, 3763, 3853, 3943, 4079, 4169, 4259, 4349, 4439, 4492, 4529, 4582, 4619, 4672, 4709, 4762, 4799, 4852, 4889, 4942
Offset: 1

Views

Author

Klaus Brockhaus, Jul 07 2001

Keywords

Comments

Subsequence of A023108.

Examples

			The trajectory of 394 reaches 887 in one step and 887 is a term in the trajectory of 196, so 394 belongs to the present sequence. The corresponding term in A063050, giving the number of steps, accordingly is 1.
		

References

  • Popular Computing (Calabasas, CA), The 196 Problem, Vol. 3 (No. 30, Sep 1975), page PC30-9. Gives initial terms of this sequence.

Crossrefs

Programs

  • Mathematica
    Block[{nn = 10^2, s}, s = NestList[# + IntegerReverse@ # &, 196, nn]; Rest@ Select[Range@ 5000, Length@NestWhileList[# + IntegerReverse@ # &, #, FreeQ[s, #] &, 1, nn] <= nn &]] (* Michael De Vlieger, Jan 21 2018 *)

Extensions

Offset corrected by Sean A. Irvine, Apr 17 2023

A072216 Consider the Reverse and Add! problem (cf. A001127); of all the n-digit numbers N which eventually reach a palindrome, pick that number N which takes the greatest number of steps to converge (in case of a tie, pick the smallest N); sequence gives values of N.

Original entry on oeis.org

5, 89, 187, 1297, 10911, 150296, 9008299, 15002893, 140669390, 1005499526, 10087799570
Offset: 1

Views

Author

N. J. A. Sloane, Jul 05 2002

Keywords

Comments

Since we do not even know if 196 eventually converges (see A006960, A023108) for n >= 3 these values are only conjectures.

Crossrefs

Extensions

Corrected and extended by Jason Doucette, May 20 2003; Oct 09 2005

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

A072217 Consider the Reverse and Add! problem (cf. A001127); of all the n-digit numbers N which eventually reach a palindrome, pick that number N which takes the greatest number of steps to converge (in case of a tie, pick the smallest N); sequence gives number of steps N takes to converge.

Original entry on oeis.org

2, 24, 23, 21, 55, 64, 96, 96, 98, 109, 149, 149, 188, 186, 201, 197, 236, 232
Offset: 1

Views

Author

N. J. A. Sloane, Jul 05 2002

Keywords

Comments

Since we do not even know if 196 eventually converges (see A006960, A023108) for n >= 3 these values are only conjectures.

Crossrefs

Extensions

Corrected and extended by Jason Doucette, Mar 29 2005; Oct 09 2005

A072218 Consider the Reverse and Add! problem (cf. A001127); of all the n-digit numbers N which eventually reach a palindrome, pick that number N which takes the greatest number of steps to converge (in case of a tie, pick the smallest N); sequence gives palindrome that is reached.

Original entry on oeis.org

11, 8813200023188, 8813200023188, 8813200023188, 4668731596684224866951378664, 682049569465550121055564965940286, 555458774083726674580862268085476627380477854555, 555458774083726674580862268085476627380477854555, 1345428953367763125675365555635765213677633598245431
Offset: 1

Views

Author

N. J. A. Sloane, Jul 05 2002

Keywords

Comments

Since we do not even know if 196 eventually converges (see A006960, A023108) for n >= 3 these values are only conjectures.

Crossrefs

A243238 Table T(n,r) of terms in the reverse and add sequences of positive integers n read by antidiagonals.

Original entry on oeis.org

1, 2, 2, 4, 4, 3, 8, 8, 6, 4, 16, 16, 12, 8, 5, 77, 77, 33, 16, 10, 6, 154, 154, 66, 77, 11, 12, 7, 605, 605, 132, 154, 22, 33, 14, 8, 1111, 1111, 363, 605, 44, 66, 55, 16, 9, 2222, 2222, 726, 1111, 88, 132, 110, 77, 18, 10, 4444, 4444, 1353, 2222, 176, 363, 121, 154, 99, 11, 11
Offset: 1

Views

Author

Felix Fröhlich, Jun 12 2014

Keywords

Examples

			T(5,6) = 88, since 88 is the 6th term in the reverse and add sequence of 5.
Table starts with:
  1 2 4 8 16 77 154 605 1111 2222
  2 4 8 16 77 154 605 1111 2222 4444
  3 6 12 33 66 132 363 726 1353 4884
  4 8 16 77 154 605 1111 2222 4444 8888
  5 10 11 22 44 88 176 847 1595 7546
  6 12 33 66 132 363 726 1353 4884 9768
  7 14 55 110 121 242 484 968 1837 9218
  8 16 77 154 605 1111 2222 4444 8888 17776
  9 18 99 198 1089 10890 20691 40293 79497 158994
  10 11 22 44 88 176 847 1595 7546 14003
		

Crossrefs

Rows n=1, 3, 5, 7, 9 give: A001127, A033648, A033649, A033650, A033651.
Main diagonal gives A244058.

Programs

  • Maple
    T:= proc(n, r) option remember; `if`(r=1, n, (h-> h +(s->
          parse(cat(s[-i]$i=1..length(s))))(""||h))(T(n, r-1)))
        end:
    seq(seq(T(n, 1+d-n), n=1..d), d=1..12);  # Alois P. Heinz, Jun 18 2014
  • Mathematica
    rad[n_] := n + FromDigits[Reverse[IntegerDigits[n]]];
    T[n_, 1] := n; T[n_, k_] := T[n, k] = rad[T[n, k-1]];
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Apr 08 2016 *)
Previous Showing 11-20 of 70 results. Next