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

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

A118512 Define sequence S_m by: initial term = m, reverse digits and add 1 to get next term. Entry shows S_11. This reaches a cycle of length 9 in 18 steps.

Original entry on oeis.org

11, 12, 22, 23, 33, 34, 44, 45, 55, 56, 66, 67, 77, 78, 88, 89, 99, 100, 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, May 06 2006

Keywords

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits[Reverse[IntegerDigits[#]]]+1&,11,90] (* Harvey P. Dale, Oct 16 2011 *)
    Join[{11,12,22,23,33,34,44,45,55,56,66,67,77,78,88,89,99,100},LinearRecurrence[{0,0,0,0,0,0,0,0,1},{2,3,4,5,6,7,8,9,10},72]] (* Ray Chandler, Jul 18 2015 *)
    NestList[IntegerReverse[#]+1&,11,90] (* Harvey P. Dale, Oct 13 2024 *)

A118513 Define sequence S_m by: initial term = m, reverse digits and add 1 to get next term. Entry shows S_13. This reaches a cycle of length 9 in 15 steps.

Original entry on oeis.org

13, 32, 24, 43, 35, 54, 46, 65, 57, 76, 68, 87, 79, 98, 90, 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, May 06 2006

Keywords

Crossrefs

Programs

  • Mathematica
    Join[{13,32,24,43,35,54,46,65,57,76,68,87,79,98,90},LinearRecurrence[{0,0,0,0,0,0,0,0,1},{10,2,3,4,5,6,7,8,9},73]] (* Ray Chandler, Jul 18 2015 *)
    NestList[IntegerReverse[#]+1&,13,90] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 06 2019 *)

A118511 Define sequence S_n by: initial term = n, reverse digits and add 1 to get next term. It is conjectured that S_n always reaches a cycle of length 9, as in A117230. Sequence gives number of steps for S_n to reach the cycle.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 17, 15, 13, 11, 9, 7, 5, 3, 1, 16, 16, 15, 13, 11, 9, 7, 5, 3, 1, 14, 14, 14, 13, 11, 9, 7, 5, 3, 1, 12, 12, 12, 12, 11, 9, 7, 5, 3, 1, 10, 10, 10, 10, 10, 9, 7, 5, 3, 1, 8, 8, 8, 8, 8, 8, 7, 5, 3, 1, 6, 6, 6, 6, 6, 6, 6, 5, 3, 1, 4, 4, 4, 4, 4, 4, 4
Offset: 1

Views

Author

N. J. A. Sloane, May 06 2006

Keywords

Crossrefs

For records see A118510. Cf. A117831. S_1 is A117230, S_11 is A118512, S_13 is A118513.
Showing 1-4 of 4 results.