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

A075488 Length of iteration list when Collatz-function is iterated with initial value -1+3^n.

Original entry on oeis.org

2, 4, 11, 10, 97, 96, 33, 32, 44, 43, 135, 134, 133, 132, 100, 99, 191, 190, 140, 139, 262, 261, 428, 427, 395, 394, 331, 330, 391, 390, 389, 388, 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, 747, 746
Offset: 1

Views

Author

Labos Elemer, Sep 26 2002

Keywords

Comments

n=3, -1+3^n = 26, list = {26,13,40,20,10,5,16,8,4,2,1}, a(3)=11.

Crossrefs

Programs

  • Mathematica
    lcoll[n_] := Length[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]]; Table[lcoll[3^i - 1], {i, 54}] (* Jayanta Basu, Jun 15 2013 *)

Formula

a(n) = A008908(3^n-1).

A075484 Length of iteration-list when Collatz-function(A006370) is iterated with initial value 5^n.

Original entry on oeis.org

1, 6, 24, 109, 26, 124, 147, 139, 100, 92, 115, 337, 135, 277, 181, 261, 240, 219, 286, 322, 451, 337, 303, 432, 243, 540, 408, 444, 304, 464, 438, 554, 484, 582, 517, 677, 462, 617, 1002, 539, 655, 709, 714, 737, 623, 708, 868, 723, 707, 676, 642, 833, 776
Offset: 0

Views

Author

Labos Elemer, Sep 26 2002

Keywords

Examples

			n=2: 5^n=25, list={25, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10.5, 16, 8, 4, 2, 1}, a(2)=24.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, 5^n, # != 1 &]], {n, 0, 52}] (* Michael De Vlieger, Feb 25 2017 *)

Formula

a(n) = A008908(5^n).

A075486 Length of iteration list when Collatz-function is iterated with initial value 2^n + 1.

Original entry on oeis.org

8, 6, 20, 13, 27, 28, 122, 123, 36, 37, 157, 114, 53, 54, 99, 100, 101, 102, 103, 73, 167, 168, 169, 170, 171, 172, 248, 174, 188, 189, 252, 253, 179, 180, 318, 244, 196, 197, 154, 155, 156, 157, 401, 327, 496, 497, 162, 163, 332, 333, 409, 472, 411, 412, 338
Offset: 1

Views

Author

Labos Elemer, Sep 26 2002

Keywords

Comments

n=4, 1+2^n = 17, list = {17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1}, so a(4) = 13.

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[Length[Collatz[2^n + 1]], {n, 100}] (* T. D. Noe, Jan 17 2013 *)

Formula

a(n) = A008908(2^n+1).

A212653 Number of steps to reach 1 in the Collatz (3x+1) problem starting with 3^n + 1.

Original entry on oeis.org

1, 2, 6, 18, 110, 21, 95, 32, 75, 74, 42, 134, 133, 132, 131, 143, 204, 128, 189, 139, 94, 93, 260, 427, 90, 257, 393, 330, 254, 253, 389, 388, 387, 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, 500, 499, 449, 497, 496, 751, 494, 493, 492, 747, 490, 745
Offset: 0

Views

Author

Michel Lagneau, Feb 14 2013

Keywords

Comments

It is interesting to note that the quantity 3^k + 1 appears in the formula: A006577(n + 2^A006666(n)) = A006577(n) + A006577(1 + 3^A006667(n)) where A006577 is the n number of halving and tripling steps to reach 1 in '3x+1' problem, A006666 is the number of halving steps to reach 1 and A006667 the number of tripling steps to reach 1.
For example with n = 19, A006577(19 + 2^14) = A006577(19) + A006577(1 + 3^6) => 115 = 20 + 95.

Examples

			a(2) = 6 because 3^2 + 1 = 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 with 6 iterations.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Module[{a=3^n+1, k=0}, While[a!=1, k++; If[EvenQ[a], a=a/2, a=a*3+1]]; k]; Table[f[n], {n, 100}]
    Table[Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,3^n+1,#!=1&]]-1,{n,0,60}] (* Harvey P. Dale, Sep 26 2015 *)

Formula

a(n) = A075487(n) - 1.

A070976 Number of steps to reach 1 in '3x+1' (or Collatz) problem starting with 3^n.

Original entry on oeis.org

0, 7, 19, 111, 22, 96, 33, 76, 75, 43, 135, 134, 133, 132, 144, 205, 129, 190, 140, 95, 94, 261, 428, 91, 258, 394, 331, 255, 254, 390, 389, 388, 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, 501, 500, 450, 498, 497, 752, 495, 494, 493, 748, 491, 746, 489
Offset: 0

Views

Author

Benoit Cloitre, May 17 2002

Keywords

Comments

For all n, it appears that a(n) <= 37n. For n > 22, it appears that a(n) < 16n. - T. D. Noe, Feb 02 2007
This sequence contains some unusually long runs of values that differ by 1. - Dmitry Kamenetsky, Dec 09 2016

Examples

			For n=4, 3^4 = 81, and the Collatz sequence (3x + 1 if odd, x/2 if even) goes 81, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1.  This is 22 steps, so a(4) = 22. - _Michael B. Porter_, Dec 15 2016
		

Crossrefs

Cf. A279269, A277109. Equals A006577(3^n).

Programs

  • Mathematica
    Table[Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,3^n,#>1&]]-1, {n,0,60}] (* Harvey P. Dale, Oct 13 2011 *)
  • PARI
    for(n=2,100,s=3^n; t=0; while(s!=1,t++; if(s%2==0,s=s/2,s=3*s+1); if(s==1,print1(t,","); ); ))

Formula

a(n) = A075487(n+1) = A074472(n) + 1. - T. D. Noe, Feb 02 2007

A075485 Length of iteration list when Collatz-function is iterated with initial value 2^n - 1.

Original entry on oeis.org

1, 8, 17, 18, 107, 108, 47, 48, 62, 63, 157, 158, 159, 160, 130, 131, 225, 226, 178, 179, 304, 305, 474, 475, 445, 446, 385, 386, 449, 450, 451, 452, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 853, 854
Offset: 1

Views

Author

Labos Elemer, Sep 26 2002

Keywords

Comments

Somewhat surprisingly, these iterations take almost twice as long as the iterations for 2^n + 1. See A075486. - T. D. Noe, Jan 17 2013

Examples

			n=4, 2^n - 1 = 15, list = {15, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1}, so a(4) = 18.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[Length[Collatz[2^n - 1]], {n, 100}] (* T. D. Noe, Jan 17 2013 *)

Formula

a(n) = A008908(2^n-1).

A213214 Number of steps to reach 1 in the Collatz (3x+1) problem starting with 3^n - 1.

Original entry on oeis.org

1, 3, 10, 9, 96, 95, 32, 31, 43, 42, 134, 133, 132, 131, 99, 98, 190, 189, 139, 138, 261, 260, 427, 426, 394, 393, 330, 329, 390, 389, 388, 387, 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, 500, 499, 498, 497, 496, 495, 494, 493, 492, 491, 746, 745, 488
Offset: 1

Views

Author

Michel Lagneau, Mar 02 2013

Keywords

Comments

It is interesting to note that the quantity 3^n - 1 appears in the Collatz trajectory of 2^n - 1 after n iterations (see the formula).

Examples

			a(8) = 31 because A193688(8)=47, and 47 - 2*8 = 31.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Module[{a=3^n-1, k=0}, While[a>1, k++; If[EvenQ[a], a=a/2, a=a*3+1]]; k]; Table[f[n], {n,100}]
    Table[Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,3^n-1,#>1&]]-1,{n,100}] (* Harvey P. Dale, Sep 06 2015 *)

Formula

a(n) = A193688(n) - 2*n for n > 1.
Showing 1-7 of 7 results.