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 41-45 of 45 results.

A063050 a(n) = number of 'Reverse and Add!' operations that have to be applied to the n-th term of A063049 in order to obtain a term in the trajectory of 196.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 0, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1
Offset: 0

Views

Author

Klaus Brockhaus, Jul 07 2001

Keywords

Examples

			394 is a term of A063049. One 'Reverse and Add!' operation applied to 394 leads to a term (887) in the trajectory of 196, so the corresponding term of the present sequence is 1.
		

Crossrefs

Programs

  • Mathematica
    limit = 10^3; x = NestList[ # + IntegerReverse[#] &, 196, limit];
    y = Select[Range[197, 4942],
       Intersection[NestList[ # + IntegerReverse[#] &, #, limit],
          x] != {} &];
    Table[
     Length@NestWhileList[# + IntegerReverse[#] &,
        y[[i]], ! MemberQ[x, #] &] - 1, {i, Length[y]}]
    (* Robert Price, Oct 21 2019 *)

A089381 L-th order palindromes with L > 2.

Original entry on oeis.org

10917, 11907, 11997, 12987, 13977, 14967, 15957, 16947, 17937, 18927, 19917, 20997, 21834, 21987, 22977, 23814, 23967, 23994, 24957, 25497, 25947, 25974, 26487, 26937, 27477, 27927, 27954, 28467, 28917, 29457, 29907, 29934, 30915
Offset: 1

Views

Author

Darrell Plank (jar_czar(AT)msn.com), Dec 28 2003

Keywords

Comments

Let P(m) = m/2 if m is even, m + rev(m) if m is odd, where rev(m) is m's base 10 representation reversed. It is conjectured that any number k eventually cycles when P is repeatedly applied to it. If the cycle has length L, k is called an L-th order palindrome.
It has not been proved that every number eventually cycles, but all numbers less than a million do. Palindromes of order L > 2 seem to be quite rare. 10917 is the smallest and has order 7. There are 263 less than 100000 and 7745 less than 1000000.
The first number with L > 2 that doesn't end in the same cycle as 10917 is 1000353. Other cycles are known, most of them fairly small, but one has length 327 (starting with 1447132589595).
There are an infinite number of different cycles of length 7 because one can insert any number of 9's in the middle of a number in the 7th-order cycle and get a new cycle of length 7 - e.g., taking the number 13748625 from the cycle, one can produce another cycle from 13749998625.
I believe this is not a straightforward generalization of ordinary palindromes (A002113) - they are not the same as 2nd-order palindromes. - N. J. A. Sloane, Jan 01 2004

Examples

			For most numbers, iterating P produces a cycle of length 2: e.g., 121 -> 242 -> 121 -> ...
The sequence for 10917 is 10917, 82818, 41409, 131823, 459954, 229977, 1009899, 10998900, 5499450, 2749725, 8029197, 15948405, {66433356, 33216678, 16608339, 109989000, 54994500, 27497250, 13748625} where the numbers in the brackets repeat. There are 7 numbers inside the brackets so 10917 is a 7th-order palindrome.
		

References

  • C. A. Pickover, Wonders of Numbers, Adventures in Mathematics, Mind and Meaning, Chapter 58, 'Emordnilap Numbers,' Oxford University Press, N.Y., 2001, pp. 142-144.

Crossrefs

Programs

  • Mathematica
    Step[n_] := If[ EvenQ[n], n/2, n + FromDigits[ Reverse[ IntegerDigits[n]]]]; cPalHash = 1013; clearArray = Array[{} &, cPalHash]; InsertCheck[n_, a_] := Module[{i = Mod[n, cPalHash] + 1}, a[[i]] = Append[ a[[i]], n]]; SetAttributes[ InsertCheck, HoldRest]; CheckArray[n_, a_] := MemberQ[ a[[Mod[n, cPalHash] + 1]], n]; SetAttributes[ CheckArray, HoldRest]; PalListHelper[n_, cTries_] := Module[ {ch = clearArray}, NestWhileList[ (InsertCheck[ #, ch]; Step[ # ]) &, n, Not[CheckArray[ #, ch]] &, 1, cTries]]; PalList[n_, cTries_] := Module[ {lst, nRemoved, loop}, lst = PalListHelper[n, cTries]; nRemoved = First[ First[ Position[ lst, lst[[ -1]]]]]; loop = Drop[ Take[ lst, {nRemoved, -1}], -1]; Append[ Take[ lst, {1, nRemoved - 1}], loop]]; Select[ Range[ 31000], Length[ PalList[ #, 1013][[ -1]]] > 2 &]

Extensions

Edited by Robert G. Wilson v and N. J. A. Sloane, Dec 31 2003

A243824 Two-column array A(n,s) of pairs (n,s) read by row where s is the smallest seed number such that the Reverse and Add! trajectory of s contains n (excluding cases where n=s).

Original entry on oeis.org

2, 1, 4, 1, 6, 3, 8, 1, 10, 5, 11, 5, 12, 3, 14, 7, 16, 1, 18, 9, 22, 5
Offset: 2

Views

Author

Felix Fröhlich, Jun 11 2014

Keywords

Examples

			A(10,1)=16 is in the array because 16 is the 9th number appearing in the Reverse and Add! trajectory of a smaller number.
A(10,2)=1 is in the array because 1 + 1 = 2, 2 + 2 = 4, 4 + 4 = 8, 8 + 8 = 16, so 1 is the smallest seed number whose Reverse and Add! trajectory contains 16.
Array begins:
  2 1
  4 1
  6 3
  8 1
  10 5
  11 5
  12 3
  14 7
  16 1
  18 9
  22 5
		

Crossrefs

A323796 Numbers (both the reverse and the add numbers) occurring in the Reverse and Add! graph with seed 196.

Original entry on oeis.org

97, 196, 295, 394, 493, 592, 691, 790, 689, 788, 887, 986, 496, 586, 676, 766, 856, 946, 1495, 1585, 1675, 1765, 1855, 1945, 2494, 2584, 2674, 2764, 2854, 2944, 3493, 3583, 3673, 3763, 3853, 3943, 4492, 4582, 4672, 4762, 4852, 4942, 5491, 5581, 5671, 5761, 5851, 5941, 4079, 4169, 4259, 4349, 4439, 4529, 4619
Offset: 1

Views

Author

A.H.M. Smeets, Jan 28 2019

Keywords

Comments

The graph has a tree structure with reversed edges. The tree structure is in fact a branched horsetail (a botanical term). The vertices are pairs (Added number and its Reverse). Both the Add as well as the Reverse terms are included in the sequence.
Each term in the sequence represents the number (either Added or Reversed) of the tail of the edge of the directed graph, lexicographical ordered by first the head of its edge and second the tail of the edge. The heads in the graph are the numbers in A006960.
In general, a(n) for n = A323797(m)..A323797(m+1)-1 point to A006960(m) for m > 0; for example: a(n) for n = 1..8 point to A006960(1) and a(n) for n = 9..12 point to A006960(2).
The structure seems is somewhat surprising:
a(1)..a(8) is given by 97 + 99*n0 for n0 = 0..7;
a(9)..a(12) is given by 689 + 99*n0 for n0 = 0..3
a(13)..a(54) is given by 496 + 90*n0 + 999*n1 for n0 = 0..5 and n1 = 0..6;
a(55)..a(102) is given by 4079 + 90*n0 + 999*n1 for n0 = 0..7 and n1 = 0..5;
a(103)..a(142) is given by 2794 + 90*n0 + 999*n1 for n0 = 0..7 and n1 = 0..4;
a(143)..a(182) is given by 539 + 990*n0 + 9999*n1 for n0 = 0..3 and n1 = 0..9;
a(183)..a(190) is given by 97009 + 990*n0 for n0 = 0..7;
a(191)..a(430) is given by 70799 + 900*n0 + 9990*n1 + 99999*n2 for n0 = 0..7, n1 = 0..2 and n2 = 0..8;
a(431)..a(744) is given by 1057969 + 9900*n0 + 99990*n1 + 999990*n2 for n0 = 0..7, n1 = 0..8 and n2 = 0..8, where (n0,n1,n2) = (2,3,4) must be excluded due to the fact that it results in a palindrome, 5377735.

Examples

			.   196--+--887--+  1495--+
.   691  |  788  |  5941  |
.        |       |        |
.   295--+  689--+  1585--+
.   592  |  986  |  5851  |
.        |       |        |
.   394--+       +--1675--+--7436
.   493  |          5761  |  6347
.        |                |
.   790--+          1765--+
.    97             5671  |
.                         |
.                   1855--+
.                   5581  |
.                         |
.                   1945--+
.                   5491  |
.                         |
.                   2494--+
.                   4942  |
.                         |
.                   ....  :
.                         |
.                   6940--+
.                    496
		

Crossrefs

A277338 Reverse and Add! sequence starting with 295.

Original entry on oeis.org

295, 887, 1675, 7436, 13783, 52514, 94039, 187088, 1067869, 10755470, 18211171, 35322452, 60744805, 111589511, 227574622, 454050344, 897100798, 1794102596, 8746117567, 16403234045, 70446464506, 130992928913, 450822227944, 900544455998, 1800098901007, 8801197801088, 17602285712176, 84724043932847, 159547977975595
Offset: 0

Views

Author

Matt C. Anderson, Oct 09 2016

Keywords

Comments

Apart from the initial term in both sequences, the same as A006960.
a(0) = 295; a(n+1) = a(n) + A004086(a(n)).
295 is conjectured to be the second smallest initial term which does not lead to a palindrome. Also, 196 is possibly the smallest initial term which does not lead to a palindrome. a(0) = 196 is described in A006960.

Examples

			a(0) = 295
a(1) = 295 + 592 = 887
a(2) = 887 + 788 = 1675
...
		

Crossrefs

Cf. A004086.
Almost the same as A006960.
See index entries at A023108.

Programs

  • Maple
    with(StringTools):
    revnum := proc (n)
    local a, b, c;
    description "to REVerse the digits of a NUMber";
    a := convert(n, string);
    b := Reverse(a);
    c := convert(b, decimal, 10)
    end proc;
    f := 0;
    e := 295;
    count := 0;
    while f <> e do
    e := e+f;
    f := revnum(e);
    count := count+1
    end do;
  • Mathematica
    a[1] = 295; a[n_] := a[n] = FromDigits@ Reverse@ IntegerDigits@ # + # &@ a[n - 1]; Array[a, 29] (* Michael De Vlieger, Oct 14 2016 *)
  • PARI
    terms(n) = my(x=295, i=0); while(1, print1(x, ", "); x=x+eval(concat(Vecrev(Str(x)))); i++; if(i==n, break))
    /* Print initial 30 terms as follows: */
    terms(30) \\ Felix Fröhlich, Nov 15 2016

Formula

a(n) = A006960(n) for n >= 1.
a(n) = A243238(295, n+1). - Felix Fröhlich, Nov 20 2016
Previous Showing 41-45 of 45 results.