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-7 of 7 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

A118522 Define sequence S_n by: initial term = n, reverse digits and add 3 to get next term. It is conjectured that S_n always reaches a cycle. Sequence gives number of steps for S_n to reach a cycle.

Original entry on oeis.org

1, 3, 3, 0, 2, 2, 0, 1, 1, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 3, 0, 0, 14, 0, 0, 0, 4, 0, 0, 3, 0, 0, 11, 5, 13, 10, 3, 6, 6, 1, 5, 5, 4, 0, 0, 4, 0, 0, 0, 2, 0, 0, 7, 0, 0, 12, 0, 0, 0, 2, 0, 0, 7, 0, 0, 9, 3, 11, 8, 1, 4, 4, 2, 3, 3, 2, 0, 0, 2, 0, 0, 0, 6, 0, 0, 5, 0, 0, 10, 0, 0, 0, 6, 0, 0
Offset: 1

Views

Author

N. J. A. Sloane, May 06 2006

Keywords

Comments

Initial cycles have length 3 or 6.
From Lars Blomberg, Jan 15 2018: (Start)
For n < 10^8, the only cycles found are the following:
[4,7,10]
[18,84,51]
[29,95,62]
[11,14,44,47,77,80]
[12,24,45,57,78,90]
[15,54,48,87,81,21]
[16,64,49,97,82,31]
[19,94,52,28,85,61]
[22,25,55,58,88,91]
[26,65,59,98,92,32]
The union of all of them has 51 terms (= 3*3 + 7*6): [4, 7, 10, 11, 12, 14, 15, 16, 18, 19, 21, 22, 24, 25, 26, 28, 29, 31, 32, 44, 45, 47, 48, 49, 51, 52, 54, 55, 57, 58, 59, 61, 62, 64, 65, 77, 78, 80, 81, 82, 84, 85, 87, 88, 90, 91, 92, 94, 95, 97, 98] (End)

Crossrefs

For records see A118523, A118524. Cf. A117831. For S_1, S_2 etc. see A118517-A118521.

A118518 Define sequence S_m by: initial term = m, reverse digits and add 3 to get next term. Entry shows S_2. This reaches a cycle of length 6 in 3 steps.

Original entry on oeis.org

2, 5, 8, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80
Offset: 1

Views

Author

N. J. A. Sloane, May 06 2006

Keywords

Crossrefs

Cf. A117831, A118517 on.

Programs

  • Mathematica
    Join[{2,5,8},LinearRecurrence[{0,0,0,0,0,1},{11,14,44,47,77,80},66]] (* Ray Chandler, Jul 18 2015 *)
    NestList[IntegerReverse[#]+3&,2,70] (* Requires Mathematica version 10 or later *) (* or *) PadRight[{2,5,8},70,{47,77,80,11,14,44}] (* Harvey P. Dale, Jun 02 2017 *)

A118519 Define sequence S_m by: initial term = m, reverse digits and add 3 to get next term. Entry shows S_3. This reaches a cycle of length 6 in 3 steps.

Original entry on oeis.org

3, 6, 9, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90
Offset: 1

Views

Author

N. J. A. Sloane, May 06 2006

Keywords

Crossrefs

Cf. A117831, A118517 on.

Programs

  • Mathematica
    Join[{3,6,9},LinearRecurrence[{0,0,0,0,0,1},{12,24,45,57,78,90},66]] (* Ray Chandler, Jul 18 2015 *)

A118521 Define sequence S_m by: initial term = m, reverse digits and add 3 to get next term. Entry shows S_6. This reaches a cycle of length 6 in 2 steps.

Original entry on oeis.org

6, 9, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90, 12, 24, 45, 57, 78, 90
Offset: 1

Views

Author

N. J. A. Sloane, May 06 2006

Keywords

Crossrefs

Cf. A117831, A118517 on.

Programs

  • Mathematica
    NestList[FromDigits[Reverse[IntegerDigits[#]]]+3&,6,70] (* Harvey P. Dale, Sep 25 2012 *)
    Join[{6,9},LinearRecurrence[{0,0,0,0,0,1},{12,24,45,57,78,90},66]] (* Ray Chandler, Jul 18 2015 *)
    PadRight[{6,9},100,{78,90,12,24,45,57}] (* Harvey P. Dale, Oct 03 2015 *)

Formula

a(n)=A118519(n+1). [From R. J. Mathar, Aug 08 2008]

A118520 Define sequence S_m by: initial term = m, reverse digits and add 3 to get next term. Entry shows S_5. This reaches a cycle of length 6 in 2 steps.

Original entry on oeis.org

5, 8, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80, 11, 14, 44, 47, 77, 80
Offset: 1

Views

Author

N. J. A. Sloane, May 06 2006

Keywords

Crossrefs

Cf. A117831, A118517 on.

Programs

  • Mathematica
    Join[{5,8},LinearRecurrence[{0,0,0,0,0,1},{11,14,44,47,77,80},66]] (* Ray Chandler, Jul 18 2015 *)

Formula

a(n) = A118518(n+1). - R. J. Mathar, Sep 02 2013
Showing 1-7 of 7 results.