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 11 results. Next

A001281 Image of n under the map n->n/2 if n even, n->3n-1 if n odd.

Original entry on oeis.org

0, 2, 1, 8, 2, 14, 3, 20, 4, 26, 5, 32, 6, 38, 7, 44, 8, 50, 9, 56, 10, 62, 11, 68, 12, 74, 13, 80, 14, 86, 15, 92, 16, 98, 17, 104, 18, 110, 19, 116, 20, 122, 21, 128, 22, 134, 23, 140, 24, 146, 25, 152, 26, 158, 27, 164, 28, 170, 29, 176, 30, 182, 31, 188
Offset: 0

Views

Author

Keywords

Comments

On the set of positive integers, the orbit of any number seems to end in the orbit of 1, of 5 or of 17. Writing n=1+q*2^p with q odd, it is easily seen that for p=0,1 and p>3, some iterations of the map lead to a strictly smaller number (for n>17). The cases p=2 and p=3 may give rise to bigger loops (depending on the form of q). See sequences A135727-A135729 for maxima of the orbits and corresponding record indices. - M. F. Hasler, Nov 29 2007

References

  • R. K. Guy, Unsolved Problems in Number Theory, E16.

Crossrefs

Cf. A037082.
Cf. A037084, A039500-A039505, A135727-A135730. See also A006370, A006577 (Collatz 3x+1 problem).

Programs

  • Maple
    f := n-> if n mod 2 = 0 then n/2 else 3*n-1; fi;
  • Mathematica
    Table[If[OddQ[n], 3*n-1, n/2], {n, 0, 100}] (* T. D. Noe, Jun 27 2012 *)
  • PARI
    A001281(n)=if(n%2,3*n-1,n>>1) \\ M. F. Hasler, Nov 29 2007

Formula

f(n) = (7n-2-(5n-2)*cos(Pi*n))/4. - Robert W. Craigen (craigen(AT)fresno.edu)
G.f.: x*(2 + x + 4*x^2)/((1 - x)^2*(1 + x)^2). - Ilya Gutkovskiy, Aug 17 2016

A039500 Iterations of "k->k/2 if k is even, k->3k-1 if k is odd" (A001281) starting at these numbers reach 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 11, 12, 15, 16, 22, 24, 29, 30, 32, 39, 43, 44, 48, 53, 57, 58, 59, 60, 64, 65, 69, 71, 77, 78, 79, 85, 86, 87, 88, 95, 96, 97, 101, 103, 105, 106, 113, 114, 115, 116, 118, 120, 127, 128, 129, 130, 135, 137, 138, 141, 142, 145, 151, 154, 155, 156
Offset: 1

Views

Author

Christian G. Bower, Feb 15 1999

Keywords

Comments

It appears that lim_{n->oo} a(n)/n = 5/2. - Benoit Cloitre, Jan 29 2006
Equivalent to the Collatz ('3n+1') problem for negative integers. - Dmitry Kamenetsky, Jan 12 2017
There are 327679 terms in this sequence which are less than 1000000. Based on this, I would suggest that the limit of a(n)/n is more likely to be 3 than 5/2. This is also a natural guess; there are three known periodic orbits for this recurrence. - David Speyer, Mar 25 2022

Crossrefs

Positive integers not in A037084.

Programs

  • Mathematica
    colln[n_]:= NestWhile[If[EvenQ[#], #/2, 3#-1] &, n, FreeQ[{1, 5, 17}, #] &]; Select[Range[156], colln[#] == 1 &] (* Jayanta Basu, Jun 06 2013 *)

A039505 Odd numbers from A039502.

Original entry on oeis.org

17, 21, 23, 25, 31, 33, 37, 41, 45, 49, 55, 61, 67, 73, 83, 91, 99, 109, 111, 117, 123, 131, 147, 153, 163, 165, 175, 179, 185, 195, 197, 209, 213, 219, 221, 225, 229, 233, 239, 243, 247, 257, 261, 263, 267, 277, 279, 291, 293, 295, 305, 311, 313, 319, 321
Offset: 1

Views

Author

Christian G. Bower, Feb 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    colln[n_]:= NestWhile[If[EvenQ[#], #/2, 3#-1] &, n, FreeQ[{1, 5, 17}, #] &]; Select[Range[1, 321, 2], colln[#] == 17 &] (* Jayanta Basu, Jun 06 2013 *)

A135730 Number of steps to reach the minimum of the final cycle under iterations of the map A001281: x->3x-1 if x odd, x/2 otherwise.

Original entry on oeis.org

0, 1, 4, 2, 0, 5, 3, 3, 11, 1, 6, 6, 9, 4, 9, 4, 0, 12, 7, 2, 8, 7, 3, 7, 16, 10, 5, 5, 10, 10, 6, 5, 19, 1, 13, 13, 14, 8, 13, 3, 9, 9, 8, 8, 22, 4, 16, 8, 17, 17, 11, 11, 16, 6, 12, 6, 29, 11, 11, 11, 7, 7, 19, 6, 37, 20, 20, 2, 19, 14, 19, 14, 15, 15, 9, 9, 14, 14, 14, 4
Offset: 1

Views

Author

M. F. Hasler, Nov 26 2007

Keywords

Comments

Under iterations of the map A001281, the orbit of any positive integer seems to end in one of 3 possible cycles, having 1, 5, resp. 17 as smallest element. This sequence gives the number of iterations needed to reach one of these values. Another sequence that could be considered is the number of iterations needed to reach /any/ element of the final cycle.
From N. J. A. Sloane, Sep 04 2015: (Start)
The same sequence arises as follows: Start at 2n-1 and repeatedly apply the map (see A261671): subtract 1 and divide by 2 if the result is odd, otherwise multiply by 3; a(n) is the number of steps to reach one of 1, 9, or 33.
It is conjectured that the trajectory of any odd number will eventually reach 1, 9, or 33, and so enter one of the loops (1,3), (9, 27, 13, 39, 19), or (33, 99, 49, 147, 73, 219, 109, 327, 163, 81, 243, 121, 363, 181, 543, 271, 135, 67). (End)

Crossrefs

Cf. A001281, A037084, A039500-A039505, A135727-A135729. A006370, A006577 (Collatz 3x+1 problem).
Cf. also A261671.
See A261673 and A261674 for records.

Programs

  • PARI
    A135730(n)=local(c=0);while( n>17 || n != 17 && n != 5 && n != 1, c++; if( n%2, n=3*n-1,n>>=1));c

A135727 Maximal value in orbit of n under the map A001281(x)=3x-1 if x odd, x/2 if x even.

Original entry on oeis.org

0, 2, 2, 8, 4, 20, 8, 20, 8, 56, 20, 32, 12, 56, 20, 44, 16, 272, 56, 56, 20, 272, 32, 272, 24, 272, 56, 80, 28, 128, 44, 272, 32, 488, 272, 104, 56, 272, 56, 128, 40, 272, 272, 128, 44, 272, 272, 140, 48, 488, 272
Offset: 0

Views

Author

M. F. Hasler, Nov 26 2007

Keywords

Comments

On the set of positive integers, the orbit of any number under A001281 seems to end in the orbit of 2, of 20 or of 272, which are the respective maxima of these cycles. Since any odd number increases under the map A001281, all elements of this sequence are even.

Crossrefs

Programs

  • PARI
    A135727(n)=local(m=n);if(n, while( n != 272 & n != 20 & n != 2, if( n%2, n=3*n-1; m=max(n,m), n>>=1)));m

A039501 Iterations of "n->n/2 if n even, n->3n-1 if n odd" (A001281) starting at these numbers reach 5.

Original entry on oeis.org

5, 7, 9, 10, 13, 14, 18, 19, 20, 26, 27, 28, 35, 36, 38, 40, 47, 51, 52, 54, 56, 63, 70, 72, 75, 76, 80, 81, 89, 93, 94, 102, 104, 107, 108, 112, 119, 121, 125, 126, 133, 139, 140, 143, 144, 149, 150, 152, 159, 160, 161, 162, 167, 177, 178, 181, 186, 187, 188, 191
Offset: 1

Views

Author

Christian G. Bower, Feb 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    it5Q[n_]:=Last[NestWhileList[If[EvenQ[#],#/2,3#-1]&,n,#!=5&,1,100]]==5; Select[Range[200],it5Q] (* Harvey P. Dale, May 09 2012 *)

A039502 Iterations of "n->n/2 if n even, n->3n-1 if n odd" (A001281) starting at these numbers reach 17.

Original entry on oeis.org

17, 21, 23, 25, 31, 33, 34, 37, 41, 42, 45, 46, 49, 50, 55, 61, 62, 66, 67, 68, 73, 74, 82, 83, 84, 90, 91, 92, 98, 99, 100, 109, 110, 111, 117, 122, 123, 124, 131, 132, 134, 136, 146, 147, 148, 153, 163, 164, 165, 166, 168, 175, 179, 180, 182, 184, 185, 195, 196
Offset: 1

Views

Author

Christian G. Bower, Feb 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    colln[n_]:= NestWhile[If[EvenQ[#], #/2, 3#-1] &, n, FreeQ[{1, 5, 17}, #] &]; Select[Range[196], colln[#] == 17 &] (* Jayanta Basu, Jun 06 2013 *)

A135728 Record indices of A135727(n) = max{ A001281^k(n);k=0,1,2,3... } (3x-1 problem).

Original entry on oeis.org

0, 1, 3, 5, 9, 17, 33, 65, 129, 153, 321, 1425, 1601, 1889, 3393, 4097, 6929, 8193, 10497, 11025, 18273, 28161, 74585, 85265, 149345, 337761, 558341, 839429, 1022105, 1467393, 7932689, 8612097, 23911397, 58882625, 75567105, 293056017
Offset: 1

Views

Author

M. F. Hasler, Nov 26 2007

Keywords

Comments

This gives indices n for which A135727(n) is larger than all preceding values of that sequence. As in A135727(n), we include the fixed point 0 in the domain of A001281. Obviously, many but not all entries are of the form 2^k+1 and not all of such numbers are in the sequence (e.g. 257, 1025, 2049 are missing). Is there a simple way of characterizing the exceptions?

Crossrefs

Programs

  • PARI
    A135728(Nmax=10^4)=local(m=-1);for(n=0,Nmax,if(m+0A135727(n)),print1(n",")))

Extensions

a(19)-a(36) from Donovan Johnson, Nov 06 2010

A135729 Record indices of A135727(n)/n = max{ A001281^k(n);k=0,1,2,3... }/n (3x-1 problem).

Original entry on oeis.org

1, 3, 5, 9, 17, 65, 129, 153, 321, 1889, 4097, 10497, 11025, 28161, 149345, 558341, 1467393, 75567105, 299480577, 344371457, 677585217, 788620517, 1951587609, 2672464025, 15958182629, 52002133905, 187559691777, 213121397657
Offset: 1

Views

Author

M. F. Hasler, Nov 26 2007

Keywords

Comments

This subsequence of A135728 gives indices n for which A135727(n)/n (ratio of maximal value to starting value) is larger than for all preceding indices. Obviously, we cannot consider the index n=0 here.

Crossrefs

Programs

  • PARI
    A135729(Nmax=10^5)=local(m=0);for(n=1,Nmax,if(m+0A135727(n)/n),print1(n",")))

Extensions

a(15)-a(28) from Donovan Johnson, Nov 06 2010

A039504 Odd numbers from A039501.

Original entry on oeis.org

5, 7, 9, 13, 19, 27, 35, 47, 51, 63, 75, 81, 89, 93, 107, 119, 121, 125, 133, 139, 143, 149, 159, 161, 167, 177, 181, 187, 191, 199, 203, 215, 223, 237, 241, 251, 255, 265, 271, 281, 285, 287, 297, 299, 317, 323, 333, 335, 341, 353, 355, 357, 361, 371, 375
Offset: 1

Views

Author

Christian G. Bower, Feb 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    colln[n_]:= NestWhile[If[EvenQ[#], #/2, 3#-1] &, n, FreeQ[{1, 5, 17}, #] &]; Select[Range[1, 375, 2], colln[#] == 5 &] (* Jayanta Basu, Jun 06 2013 *)
Showing 1-10 of 11 results. Next