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-10 of 79 results. Next

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

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

Original entry on oeis.org

1, 6, 11, 16, 66, 71, 22, 27, 77, 82, 33, 38, 88, 93, 44, 49, 99, 104, 406, 609, 911, 124, 426, 629, 931, 144, 446, 649, 951, 164, 466, 669, 971, 184, 486, 689, 991, 204, 407, 709, 912, 224, 427, 729, 932, 244, 447, 749, 952, 264, 467, 769, 972, 284, 487, 789, 992, 304, 408
Offset: 0

Views

Author

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

Keywords

Crossrefs

Programs

  • Mathematica
    NestList[IntegerReverse[#] + 5 &, 1, 100] (* Paolo Xausa, Aug 27 2024 *)

Formula

After 1 step enters a cycle of length 207.
It appears that there is a unique cycle of length 207 for the reverse-and-add-5 problem. Klaus Brockhaus has done an extensive search without finding any further cycle of length 207. There are many cycles of lengths 36 and 756. See A118878.

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

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

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

Original entry on oeis.org

1, 17, 87, 94, 65, 72, 43, 50, 21, 28, 98, 105, 517, 731, 153, 367, 779, 993, 415, 530, 51, 31, 29, 108, 817, 734, 453, 370, 89, 114, 427, 740, 63, 52, 41, 30, 19, 107, 717, 733, 353, 369, 979, 995, 615, 532, 251, 168, 877, 794, 513, 331, 149, 957
Offset: 1

Views

Author

N. J. A. Sloane, May 06 2006

Keywords

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits[Reverse[IntegerDigits[#]]]+16&,1,60] (* Harvey P. Dale, Jul 19 2011 *)

Formula

After 721 steps enters a cycle of length 90.

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

A117807 Start with 1015 and repeatedly reverse the digits and add 4 to get the next term.

Original entry on oeis.org

1015, 5105, 5019, 9109, 9023, 3213, 3127, 7217, 7131, 1321, 1235, 5325, 5239, 9329, 9243, 3433, 3347, 7437, 7351, 1541, 1455, 5545, 5459, 9549, 9463, 3653, 3567, 7657, 7571, 1761, 1675, 5765, 5679, 9769, 9683, 3873, 3787, 7877, 7791, 1981, 1895, 5985, 5899, 9989, 9903, 3103, 3017, 7107, 7021, 1211, 1125, 5215, 5129, 9219, 9133, 3323, 3237, 7327, 7241, 1431, 1345, 5435, 5349, 9439, 9353, 3543, 3457, 7547, 7461, 1651, 1565, 5655, 5569, 9659, 9573, 3763, 3677, 7767, 7681, 1871, 1785, 5875, 5789, 9879, 9793, 3983, 3897, 7987, 7901, 1101
Offset: 1

Views

Author

Klaus Brockhaus, May 05 2006

Keywords

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits[Reverse[IntegerDigits[#]]]+4&,1015,90] (* Harvey P. Dale, Jul 18 2015 *)

Formula

Has period 90. A full period is shown.

A117829 Start with 3 and repeatedly reverse the digits and add 4 to get the next term.

Original entry on oeis.org

3, 7, 11, 15, 55, 59, 99, 103, 305, 507, 709, 911, 123, 325, 527, 729, 931, 143, 345, 547, 749, 951, 163, 365, 567, 769, 971, 183, 385, 587, 789, 991, 203, 306, 607, 710, 21, 16, 65, 60, 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

Crossrefs

Programs

  • Maple
    read transforms; t1:=[3]; for n from 1 to 80 do t1:=[op(t1),4+digrev(t1[n])]; od: # N. J. A. Sloane
  • Mathematica
    f[n_] := 4 + FromDigits@ Reverse@ IntegerDigits@n; NestList[ f@# &, 3, 58] (* James C. McMahon, Sep 24 2024 *)
    NestList[IntegerReverse[#]+4&,3,60] (* Harvey P. Dale, Feb 17 2025 *)

Formula

Has period 54: see A117827, A117830.

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

Original entry on oeis.org

1, 11, 21, 22, 32, 33, 43, 44, 54, 55, 65, 66, 76, 77, 87, 88, 98, 99, 109, 911, 129, 931, 149, 951, 169, 971, 189, 991, 209, 912, 229, 932, 249, 952, 269, 972, 289, 992, 309, 913, 329, 933, 349, 953, 369, 973, 389, 993, 409, 914, 429, 934, 449, 954, 469, 974, 489, 994, 509
Offset: 1

Views

Author

David Applegate, May 05 2006

Keywords

Comments

This sequence (unlike A117828, say) never cycles.
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. - Martin Fuller, May 12 2006

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits[Reverse[IntegerDigits[#]]]+10&,1,60] (* Harvey P. Dale, May 19 2012 *)
    NestList[IntegerReverse[#]+10&,1,60] (* Harvey P. Dale, May 29 2025 *)
Showing 1-10 of 79 results. Next