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

A117830 Let S_m be the infinite sequence formed by starting with m and repeatedly reversing the digits and adding 4 to get the next term. For all m < 1015, S_m enters the cycle of length 54 whose terms are shown here.

Original entry on oeis.org

5, 9, 13, 35, 57, 79, 101, 105, 505, 509, 909, 913, 323, 327, 727, 731, 141, 145, 545, 549, 949, 953, 363, 367, 767, 771, 181, 185, 585, 589, 989, 993, 403, 308, 807, 712, 221, 126, 625, 530, 39, 97, 83, 42, 28, 86, 72, 31, 17, 75, 61, 20, 6, 10, 5, 9, 13, 35, 57, 79, 101, 105, 505, 509, 909, 913, 323, 327, 727, 731, 141, 145
Offset: 1

Views

Author

Luc Stevens (lms022(AT)yahoo.com), Apr 06 2006

Keywords

Comments

S_1015 is the first exception: this immediately enters the cycle of length 90 shown in A117807. - Klaus Brockhaus, May 05 2006
Except for the initial 1, identical to A117828.

Crossrefs

S_1 is given in A117828, S_3 in A117829. See also A117827, A117831, A117807.

Formula

a(n) = A117828(n+1). - M. F. Hasler, May 22 2014

Extensions

Edited by N. J. A. Sloane, May 05 2006

A118474 Where records occur in A117831.

Original entry on oeis.org

1, 3, 18, 29, 44, 104, 111, 297, 392, 479, 574, 1013, 1994, 10013, 10115, 10135, 10155, 10175, 10195, 11021, 30013, 49999, 59994, 100022, 199018, 239991, 389928, 429983, 979924, 1000013, 1001015, 1001035, 1001055, 1001075, 1001095, 1001195, 1001295
Offset: 1

Views

Author

N. J. A. Sloane, May 05 2006

Keywords

Comments

a(1) to a(13) enter the only cycle of length 54 (cf. A117830), a(14) to a(29) enter a cycle of length 90 (cf. A117807), a(30) to a(45) enter a cycle of length 1890.

Crossrefs

Extensions

a(8)-a(13) from N. J. A. Sloane, May 06 2006
a(14)-a(20) from Klaus Brockhaus, May 07 2006
a(21)-a(37) from Klaus Brockhaus, Aug 01 2006

A119455 Start with 1027 and repeatedly reverse the digits and add 16 to get the next term.

Original entry on oeis.org

1027, 7217, 7143, 3433, 3359, 9549, 9475, 5765, 5691, 1981, 1907, 7107, 7033, 3323, 3249, 9439, 9365, 5655, 5581, 1871, 1797, 7987, 7913, 3213, 3139, 9329, 9255, 5545, 5471, 1761, 1687, 7877, 7803, 3103, 3029, 9219, 9145, 5435, 5361, 1651, 1577, 7767, 7693, 3983, 3909, 9109, 9035, 5325, 5251, 1541, 1467, 7657, 7583, 3873, 3799, 9989, 9915, 5215, 5141, 1431, 1357, 7547, 7473, 3763, 3689, 9879, 9805, 5105, 5031, 1321, 1247, 7437, 7363, 3653, 3579, 9769, 9695, 5985, 5911, 1211, 1137, 7327, 7253, 3543, 3469, 9659, 9585, 5875, 5801, 1101
Offset: 1

Views

Author

Klaus Brockhaus, May 20 2006

Keywords

Comments

Has period 90. A full period is shown. Starting with 1027 + 2*k for k = 1, ..., 18 gives other sequences with period 90.

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits[Reverse[IntegerDigits[#]]]+16&,1027,90] (* Harvey P. Dale, Mar 11 2015 *)
    NestList[IntegerReverse[#]+16&,1027,90] (* Harvey P. Dale, Apr 26 2025 *)
Showing 1-4 of 4 results.