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-8 of 8 results.

A117816 Number of steps until the RADD sequence T(k+1) = n + R(T(k)), T(0) = 1, enters a cycle; -1 if no cycle is ever reached. (R=A004086: reverse digits).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 2, 31, 15, -1, 721, 9, 1, 6, -1, 3, 5, 28, 29, 131, 23, 1, 31, 6, -1, 1, 19, 1, 53, 4, 406, 34, 254, 8, -1, 3, 245, 1, 3, 2, 422, 42, 308, 1, -1, 2, 2, 49, 1, 1371, 13, 1, 1, 2, -1, 78, 65, 1, 809, 1575, 5, 43, 31, 2, -1, 33, 2, 21, 192, 857, 91, 1, 2, 2, -1, 2, 491, 1, 2, 1, 81, 49, 1, 2, -1, 35, 197, 72, 1, 12, 79, 1, 6004, 1, -1, 52, 10264, 9, 28, 2, 2, 1, 427, 1, -1, 1, 1, 49, 167
Offset: 1

Views

Author

N. J. A. Sloane, following discussions with Luc Stevens, May 04 2006

Keywords

Comments

Comments following discussions with David Applegate, May 05 2006: (Start)
Certainly a(10) = -1 and probably a(n) is always -1 if n is a multiple of 10. Furthermore a(15) is almost certainly -1: T_15 has not reached a cycle in 10^7 terms (see A118532).
(End)
If n is a multiple of 10 the operation can never generate a trailing zero and so is reversible. So it loops only if it returns to the start, which is impossible. Hence a(10k) = -1. - Martin Fuller, May 12 2006
I suspect a(115) = 385592406, A117817(115) = 79560. Can someone confirm? - Martin Fuller, May 12 2006
The map f: x -> R(x)+n is injective, f(x)=f(y) <=> R(x)=R(y) <=> x=y, unless x or y only differ in trailing zeros. For n=10k, however, trailing zeros can never occur. (This also implies that the terms are of increasing length.) Thus, for n=10k, no number can occur twice in the orbit of 1 under f, i.e., a(10k)=-1. A sketch of proof for a(15)=-1 is given in A118532. As of today, no other n with a(n)=-1 seems to be known. - M. F. Hasler, May 06 2012

Examples

			T_2 enters a cycle of length 81 after 1 step.
		

Crossrefs

For T_1, T_2, ..., T_16 (omitting T_9, which is uninteresting) see A117230, A117521, A118517, A117828, A117800, A118525, A118526, A118527, A117841, A118528, A118529, A118530, A118531, A118532, A118533.
Cf. A117817.

Programs

  • Mathematica
    ReverseNum[n_] := FromDigits[Reverse[IntegerDigits[n]]]; maxLen=10000; Table[z=1; lst={1}; While[z=ReverseNum[z]+n; !MemberQ[lst,z] && Length[lst]T. D. Noe *)
  • PARI
    A117816(n,L=10^5,S=1)={ for(F=0,1, my(u=Vecsmall(S)); while(L-- & #u<#u=vecsort(concat(u,Vecsmall(S=A004086(S)+n)),,8),); L || F=1; /* 1st run counts until repetition, now subtract cycle length */ F || L=1+#u); L-1}

Extensions

a(21)-a(33) from Luc Stevens, May 08 2006
a(33) onwards from T. D. Noe, May 10 2006
Further terms from Martin Fuller, May 12 2006

A117831 Let S_n be the infinite sequence formed by starting with n and repeatedly reversing the digits and adding 4 to get the next term. Sequence gives number of steps for S_n to reach a cycle, or -1 if no cycle is ever reached.

Original entry on oeis.org

1, 1, 40, 7, 0, 0, 39, 6, 0, 0, 38, 5, 0, 18, 37, 3, 0, 43, 10, 0, 4, 42, 9, 4, 4, 41, 7, 0, 47, 40, 0, 8, 46, 13, 0, 8, 45, 11, 0, 7, 44, 0, 12, 50, 17, 3, 12, 49, 15, 1, 11, 48, 1, 16, 36, 3, 0, 16, 35, 1, 0, 41, 8, 2, 2, 40, 7, 2, 2, 39, 5, 0, 45, 12, 0, 6, 44, 11, 0, 6, 43, 9, 0, 49, 42, 0, 10
Offset: 1

Views

Author

N. J. A. Sloane, following discussions with Luc Stevens, May 03 2006

Keywords

Comments

It is conjectured that S_n always reaches a cycle.
There are 22 different cycles of length 90 with 4-digit components. I guess that at most half of the numbers between 1000 and 10000 lead to the cycle of length 54 shown in A117830. - Klaus Brockhaus, May 05 2006

Crossrefs

S_1 is given in A117828, S_3 in A117829, S_1015 in A117807.
Records are in A118473, A118474.
Full list of sequences on this topic (1): A117230, A117521, A117800, A117816, A117817, A117827, A117828, A117829, A117830, A117831 (this sequence)
Full list of sequences on this topic (2): A117837, A117841, A118473, A118474, A118510, A118511, A118512, A118513, A118514, A118515, A118516
Full list of sequences on this topic (3): A118517-A118533, A118535

Programs

  • Maple
    V:= Vector(10^5,-1):
    f:= proc(n)
      local L, H, S, i, j,found,x,y;
      global V;
      S:= {n}: H:= n; x:= n;
      for i from 1 to 10^5 do
        if V[x] > -1 then
           for j from 1 to i-1 do V[H[j]]:= i-j+V[x] od;
           return V[n];
        fi;
        L:= convert(x,base,10);
        x:= add(L[-j]*10^(j-1),j=1..nops(L)) + 4;
        if member(x, S) then
          found:= false; y:= 0;
          V[x]:= 0;
          for j from i by -1 to 1 do
            if H[j] = x then found:= true
            elif not found then V[H[j]]:= 0
            else y:= y+1; V[H[j]]:= y;
            fi
          od;
          return V[n]
        fi;
        H:= H, x;
        S:= S union {x};
      od;
    end proc:
    map(f, [$1..200]); # Robert Israel, May 07 2020

Extensions

Corrected and extended by Klaus Brockhaus, May 05 2006
Confirmed by N. J. A. Sloane, May 05 2006

A117230 Start with 1 and repeatedly reverse the digits and add 1 to get the next term.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, following discussions with Luc Stevens, May 04 2006

Keywords

Crossrefs

Programs

  • Maple
    read transforms; t1:=[1]; for n from 1 to 80 do t1:=[op(t1),1+digrev(t1[n])]; od:
  • Mathematica
    Join[{1},LinearRecurrence[{0,0,0,0,0,0,0,0,1},{2,3,4,5,6,7,8,9,10},99]] (* Ray Chandler, Jul 18 2015 *)
  • PARI
    a(n)=if(n>1,(n-2)%9+2,1) \\ M. F. Hasler, May 22 2014

Formula

Has period 9.
G.f.: -x*(9*x^9 +9*x^8 +8*x^7 +7*x^6 +6*x^5 +5*x^4 +4*x^3 +3*x^2 +2*x +1) / ((x -1)*(x^2 +x +1)*(x^6 +x^3 +1)). - Colin Barker, May 23 2014

Extensions

Correction to the terms of the sequence (inserted missing term) Jeremy Gardiner, Jun 17 2010

A118878 Let T(S,Q) be the sequence obtaining by starting with S and repeatedly reversing the digits and adding Q to get the next term. a(n) is the number of steps for T(n,5) to reach a cycle, or -1 if no cycle is ever reached.

Original entry on oeis.org

1, 190, 1, 87, 1, 0, 189, 0, 86, 0, 0, 188, 0, 85, 191, 0, 0, 95, 0, 190, 1, 0, 184, 0, 3, 187, 0, 0, 91, 0, 96, 0, 0, 180, 88, 0, 183, 0, 0, 87, 1, 92, 0, 0, 3, 84, 0, 179, 0, 0, 191, 0, 88, 0, 2, 190, 2, 87, 2, 1, 2, 97, 2, 192, 3, 0, 186, 0, 83, 189, 0, 0, 93, 0, 98, 0, 0, 182, 0, 1, 185, 0, 0, 89, 3, 94, 0, 0, 178, 86, 0, 181, 0, 0, 193, 0, 90, 0, 0, 1
Offset: 1

Views

Author

N. J. A. Sloane, May 26 2006

Keywords

Comments

Is a(n) ever -1? If so then n > 10000.
The cycle has length 207 for S <= 1015, but for S = 1016 it has length 36 (see A118879).

Crossrefs

A118879 Let T(S,Q) be the sequence obtaining by starting with S and repeatedly reversing the digits and adding Q to get the next term. This is T(1016,5), the first S for which T(S,5) reaches a cycle of length 36.

Original entry on oeis.org

1016, 6106, 6021, 1211, 1126, 6216, 6131, 1321, 1236, 6326, 6241, 1431, 1346, 6436, 6351, 1541, 1456, 6546, 6461, 1651, 1566, 6656, 6571, 1761, 1676, 6766, 6681, 1871, 1786, 6876, 6791, 1981, 1896, 6986, 6901, 1101, 1016, 6106, 6021
Offset: 0

Views

Author

N. J. A. Sloane, May 26 2006

Keywords

Comments

The cycle is simply the first 36 terms, which then repeat.
For S < 1016, T(S,5) reaches a cycle of length 207 (cf. A117800).

Crossrefs

Programs

  • Mathematica
    NestList[IntegerReverse[#]+5&,1016,40] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 05 2020 *)

A119903 Records in A118878.

Original entry on oeis.org

1, 190, 191, 192, 193, 8486, 16525, 16526, 16527, 16528, 16529, 16530, 825992, 1624591, 1624787, 1624983, 1625179, 1625375, 1625571, 1625767, 1625963, 1626159, 1626355, 1626391, 1626392, 1626393, 1626394, 1626395, 1626396, 82253978, 162059977, 162079973
Offset: 1

Views

Author

Klaus Brockhaus, May 28 2006

Keywords

Crossrefs

Programs

  • C
    See Links section.

Extensions

More terms from Rémy Sigrist, Aug 13 2022

A119904 Where records occur in A118878.

Original entry on oeis.org

1, 2, 15, 64, 95, 111, 119, 411, 604, 995, 1035, 4945, 10011, 10109, 10119, 10129, 10139, 10149, 10159, 10169, 10179, 10189, 10199, 11009, 40011, 60004, 99995, 100035, 499945, 1000011, 1001009, 1001019, 1001029, 1001039, 1001049, 1001059, 1001069, 1001079
Offset: 1

Views

Author

Klaus Brockhaus, May 28 2006

Keywords

Crossrefs

Programs

  • C
    See Links section.

Extensions

More terms from Rémy Sigrist, Aug 13 2022

A119902 Start with 100016 and repeatedly reverse the digits and add 5 to get the next term.

Original entry on oeis.org

100016, 610006, 600021, 120011, 110026, 620016, 610031, 130021, 120036, 630026, 620041, 140031, 130046, 640036, 630051, 150041, 140056, 650046, 640061, 160051, 150066, 660056, 650071, 170061, 160076, 670066, 660081, 180071, 170086, 680076
Offset: 1

Views

Author

Klaus Brockhaus, May 28 2006

Keywords

Comments

Let T(S,Q) be the sequence obtained by starting with S and repeatedly reversing the digits and adding Q to get the next term. This is T(10016,5). 100016 is the first S for which T(S,5) reaches a cycle of length 756. The cycle is simply the first 756 terms, which then repeat. A full period is given in the table.

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits[Reverse[IntegerDigits[#]]]+5&,100016,40]  (* Harvey P. Dale, Feb 24 2011 *)
Showing 1-8 of 8 results.