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

A119451 Let S_n be the infinite sequence formed by starting with n and repeatedly reversing the digits and adding 16 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

721, 708, 686, 709, 714, 656, 724, 756, 662, 721, 708, 695, 664, 732, 728, 715, 720, 707, 685, 708, 713, 655, 723, 755, 661, 15, 707, 712, 699, 686, 700, 732, 710, 0, 729, 1, 694, 654, 731, 709, 687, 710, 715, 657, 725, 757, 663, 722, 709, 714, 701, 688, 702
Offset: 1

Views

Author

Klaus Brockhaus, May 20 2006

Keywords

Comments

It is conjectured that S_n always reaches a cycle.
There is one cycle of length 54 (least component is 34, all components have at most four digits, cf. A119454), 19 different cycles of length 90 with 4-digit components (least components are 1027 + 2*k for k = 0, ..., 18, cf. A119455), 444 different cycles of length 450 with 6-digit components, 3 different cycles of length 810 with 6-digit components (least components are 101007, 101011, 101015), 19 different cycles of length 1890 with 6-digit components (least components are 100027 + 2*k for k = 0, ..., 18) and at least 19 different cycles of length 19890 with 8-digit components (least components are 10000027 + 2*k for k = 0, ..., 18).

Crossrefs

S_1 is given in A118533. Records: A119452; where records occur: A119453. Cycles of length 54 and 90 are in A119454 and A119455.

A119452 Records in A119451.

Original entry on oeis.org

721, 724, 756, 757, 759, 762, 764, 765, 768, 769, 828, 1334, 1337, 1340, 8618, 8728, 8738, 8748, 8753, 8754, 8755, 8756, 8757, 62607, 62630, 62633, 118133, 119113, 139525
Offset: 1

Views

Author

Klaus Brockhaus, May 20 2006

Keywords

Crossrefs

A119453 Where records occur in A119451.

Original entry on oeis.org

1, 7, 8, 46, 122, 155, 276, 305, 356, 1006, 1025, 1335, 3015, 3876, 10179, 10399, 12219, 14039, 19998, 28991, 57982, 66975, 95966, 102215, 110023, 399996, 1000019, 1000021, 1001083
Offset: 1

Views

Author

Klaus Brockhaus, May 20 2006

Keywords

Crossrefs

A119454 Start with 34 and repeatedly reverse the digits and add 16 to get the next term.

Original entry on oeis.org

34, 59, 111, 127, 737, 753, 373, 389, 999, 1015, 5117, 7131, 1333, 3347, 7449, 9463, 3665, 5679, 9781, 1895, 5997, 8011, 1124, 4227, 7240, 443, 360, 79, 113, 327, 739, 953, 375, 589, 1001, 1017, 7117, 7133, 3333, 3349, 9449, 9465, 5665, 5681, 1881, 1897, 7997, 8013, 3124, 4229, 9240, 445, 560, 81
Offset: 1

Views

Author

Klaus Brockhaus, May 20 2006

Keywords

Comments

Has period 54. A full period is shown.
There are infinitely many numbers that eventually reach this cycle (e.g. 8100). What is the smallest? - N. J. A. Sloane, May 21 2006
The smallest number that eventually reaches this cycle is 26 (cf. A119481). - Klaus Brockhaus, May 23 2006

Crossrefs

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 *)

A119481 Numbers n that eventually reach the cycle given in A119454 by starting with n and repeatedly reversing the digits and adding 16.

Original entry on oeis.org

26, 34, 36, 56, 59, 78, 79, 81, 103, 111, 113, 127, 135, 136, 154, 164, 165, 181, 183, 184, 192, 197, 205, 213, 215, 235, 260, 283, 285, 286, 307, 315, 317, 327, 328, 336, 340, 355, 360, 365, 366, 373, 375, 389, 397, 398, 423, 442, 443, 445, 467, 475, 477
Offset: 1

Views

Author

Klaus Brockhaus, May 23 2006

Keywords

Crossrefs

Showing 1-8 of 8 results.