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.

Previous Showing 11-20 of 44 results. Next

A064433 Number of iterations of A064455 to reach 2 (or 1 in the case of 1).

Original entry on oeis.org

1, 1, 2, 6, 3, 5, 7, 12, 4, 14, 6, 11, 8, 8, 13, 13, 5, 10, 15, 15, 7, 7, 12, 12, 9, 17, 9, 71, 14, 14, 14, 68, 6, 19, 11, 11, 16, 16, 16, 24, 8, 70, 8, 21, 13, 13, 13, 67, 10, 18, 18, 18, 10, 10, 72, 72, 15, 23, 15, 23, 15, 15, 69, 69, 7, 20, 20, 20, 12, 12, 12, 66, 17, 74, 17
Offset: 1

Views

Author

Jonathan Ayres (Jonathan.ayres(AT)btinternet.com), Oct 01 2001

Keywords

Comments

Similar to 3x+1 series (A008908). Does this sequence converge to 2 for all values of n (true for all values of n up to 100000)? The inverse sequence using next n = n-int(n/2) for n even and n+int(n/2) for n odd leads to 3 (?) possible end sequences (1), (5, 7, 10) and (17, 25, 37, 55, 82, 41, 61, 91, 136, 68, 34)
Starting with a number n, the next value generated is n+int(n/2) if n is even, n-int(n/2) if n is odd; a(n) is the number of iteration for the initial value n to reach the limit of 1 to 2
Collatz's 3N+1 function as isometry over the dyadics is N->N/2 if even, but N->(3N+1)/2 if odd, including the (necessary) halving into each tripling step. Counting steps until reaching 1 in this way leads to this sequence instead of A008908. - Michael Vielhaber (vielhaber(AT)gmail.com), Nov 18 2009
The value at each step of a trajectory starting with n (n>1) is equal to the value plus one at the same step of the row starting with (n-1) of the irregular triangle of the abbreviated (Terras-modified) Collatz sequence (A070168). - K. Spage, Aug 07 2014

Examples

			a(4) = 6. Starting with 4, 4 is even so the next number is 4+int(4/2) = 6, 6 is even so next number is 6+int(6/2) = 9, 9 is odd so next number is 9-int(9/2) = 5, 5 is odd so next number is 5-int(5/2) = 3, 3 is odd so next number is 3-int(3/2)=2, so giving a sequence of 4,6,9,5,3,2: 6 numbers.
a(5) = 3. Starting with 5, A064455(5) = 3, A064455(3) = 2, so giving a trajectory of 5,3,2: 3 numbers. - _K. Spage_, Aug 07 2014
		

Crossrefs

Programs

  • Mathematica
    Table[Length@ NestWhileList[If[EvenQ@ #, 3 #/2, (# + 1)/2] &, n, # != 1 + Boole[n > 1] &], {n, 75}] (* Michael De Vlieger, Sep 24 2016 *)
  • PARI
    A064455(n) = {if(n%2, (n + 1)/2, 3*n/2)}
    A064433(n) = {my(c=1); if(n==1, 1, while(n!=2, n=A064455(n); c++); c)} \\ K. Spage, Aug 07 2014

Formula

a(n) = A006666(n-1) + 1. - K. Spage, Aug 04 2014

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

Original entry on oeis.org

2, 3, 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

Labos Elemer, Sep 26 2002

Keywords

Comments

n=2, 1+3^n = 10, list = {10,5,16,8,4,2,1}, so a(2)=7

Crossrefs

Programs

  • Mathematica
    coll[n_]:=Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#!=1&]]; coll /@ (3^Range[0, 60] + 1) (* Harvey P. Dale, Dec 15 2014 *)

Formula

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

A159999 Number of numbers not greater than n occurring in Collatz (3x+1) trajectory starting with n.

Original entry on oeis.org

1, 2, 3, 3, 4, 6, 5, 4, 7, 6, 7, 9, 7, 10, 7, 5, 9, 14, 11, 8, 6, 12, 9, 11, 14, 10, 10, 16, 14, 11, 10, 6, 17, 12, 9, 20, 18, 17, 18, 9, 13, 8, 20, 16, 14, 12, 13, 12, 20, 21, 18, 12, 10, 18, 15, 20, 24, 19, 22, 16, 14, 17, 15, 7, 23, 25, 22, 15, 13, 12, 16, 23
Offset: 1

Views

Author

Reinhard Zumkeller, May 04 2009

Keywords

Comments

If the Collatz conjecture is true, there are no cycles in the 3x+1 trajectory and the difference between the counts here and those of A076228 is that the start value is counted here but not there; then a(n) = 1+A076228(n) [discovered by sequencedb.net]. - R. J. Mathar, Jun 24 2021

Examples

			a(9) = #{1,2,4,5,7,8,9} = 7, as
9-28-14-7-22-11-34-17-52-26-13-40-20-10-5-16-8-[4-2-1]*
9-..-..-7-..-..-..-..-..-..-..-..-..-..-5-..-8-[4-2-1]*.
		

Crossrefs

Programs

  • Haskell
    a159999 n = length $ takeWhile (<= n) $ sort $ a070165_row n
    -- Reinhard Zumkeller, Sep 01 2012
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; f[n_] := Module[{c = Collatz[n]}, Length[Select[c, # <= n &]]]; Table[ f[n], {n, 100}] (* T. D. Noe, Mar 07 2013 *)

Formula

a(n) < n for n>6;
a(A033496(n)) = A008908(A033496(n)).
a(n) = f(n,n,1) with f(n,m,x) = if m=1 then x else f(n, A006370(m), if A006370(m)
a(n) = n - A246436(n); row lengths of triangle A214614. - Reinhard Zumkeller, Sep 01 2014

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

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

A078441 a(n) begins the first chain of n consecutive positive integers that have equal h-values, where h(k) is the length of the finite sequence k, f(k), f(f(k)), ...., 1 in the Collatz (or 3x + 1) problem. (The earliest "1" is meant.)

Original entry on oeis.org

1, 12, 28, 98, 98, 386, 943, 1494, 1680, 2987, 2987, 2987, 2987, 2987, 7083, 7083, 7083, 57346, 57346, 57346, 57346, 57346, 57346, 57346, 57346, 252548, 252548, 331778, 331778, 524289, 596310, 596310, 596310, 596310, 596310, 596310, 596310, 596310, 596310, 596310, 2886352, 3247146, 3247146, 3247146, 3247146, 3247146, 3247146, 3264428, 3264428, 3264428, 3264428, 3264428, 4585418, 4585418
Offset: 1

Author

Joseph L. Pe, Dec 31 2002

Keywords

Comments

Recall that f(n) = n/2 if n is even; = 3n + 1 if n is odd.

Examples

			28, 29, 30 is the first chain of three consecutive positive integers n, n+1, n+2 such that h(n) = h(n+1) = h(n+2). Hence a(3)=28.
		

Crossrefs

Cf. A008908 (Values of h(k)), A153330 (Differences in adjacent h(k)).

Programs

  • Mathematica
    t = Differences@ Table[Length@ NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # != 1 &], {n, 10^5}]; {1}~Join~Table[SequencePosition[t, ConstantArray[0, n - 1]][[1, 1]], {n, 2, 25}] (* Michael De Vlieger, Sep 14 2016, Version 10.1 *)

Extensions

More terms from Michel ten Voorde Jun 20 2003
a(18)-a(21) corrected and a(22)-a(54) from Donovan Johnson, Nov 14 2010
a(1)=1 prepended by Dmitry Kamenetsky, Sep 14 2016

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

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.
		

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

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

A082984 Numbers k for which the 3x+1 problem takes at least k halving and tripling steps to reach 1.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 9, 11, 14, 15, 18, 19, 27, 31, 41, 47, 54, 55, 62, 63, 71, 73, 82, 83, 91, 94, 95, 97, 108, 109, 110
Offset: 1

Author

Hauke Worpel (hw1(AT)email.com), May 29 2003

Keywords

Comments

This sequence is almost certainly full; there are no more terms below 100000.
An exhaustive search revealed no further results up to 10^9. - Gonzalo Ciruelos, Aug 02 2013
If we do not count the initial number, then 1 and 2 do not appear in this sequence. It appears that no number k has a Collatz iteration requiring more than 5*k iterations. - T. D. Noe, Feb 21 2014

Examples

			3 is in the list because it takes A006577(3) = 7 steps to reach 1 (3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1).
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Select[Range[1000], Length[Collatz[#]] >= # &] (* T. D. Noe, Feb 21 2014 *)

A333860 The maximum Hamming (binary) weight of the elements of the Collatz orbit of n, or -1 if 1 is never reached.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 3, 1, 3, 2, 3, 2, 3, 3, 4, 1, 3, 3, 4, 2, 3, 3, 4, 2, 4, 3, 8, 3, 4, 4, 8, 1, 4, 3, 4, 3, 3, 4, 5, 2, 8, 3, 4, 3, 4, 4, 8, 2, 3, 4, 4, 3, 4, 8, 8, 3, 4, 4, 5, 4, 5, 8, 8, 1, 3, 4, 4, 3, 3, 4, 8, 3, 8, 3, 4, 4, 4, 5, 6, 2, 5, 8, 8, 3, 4, 4, 5
Offset: 1

Author

Markus Sigg, Apr 08 2020

Keywords

Examples

			The Collatz orbit of 3 is 3,10,5,16,8,4,2,1. The Hamming weights are 2,2,2,1,1,1,1,1. The maximum is a(3) = 2.
		

Programs

  • Mathematica
    a[n_] := Max[DigitCount[#, 2, 1] & /@ NestWhileList[If[OddQ[#], 3*# + 1, #/2] &, n, # > 1 &]]; Array[a, 100] (* Amiram Eldar, Jul 29 2023 *)
  • PARI
    a(n) = {
    my(c = hammingweight(n));
    while(n>1, n = if(n%2 == 0, n/2, 3*n+1); c = max(c, hammingweight(n)));
    c;
    }

Formula

a(n) = max(A000120(n), A352895(n)) = max(A000120(n), a(A006370(n))). - Antti Karttunen, Apr 10 2022

Extensions

Escape clause added to the definition by Antti Karttunen, Apr 10 2022

A248037 Numbers n such that the ratio of tripling steps to halving steps in the Collatz (3x+1) trajectory of n is greater than all previous ratios.

Original entry on oeis.org

2, 3, 7, 9, 27, 230631, 626331, 837799, 1723519, 3732423, 5649499, 6649279, 8400511, 63728127, 3743559068799, 100759293214567, 104899295810901231
Offset: 1

Author

Derek Orr, Sep 29 2014

Keywords

Comments

Equivalently, numbers n such that A006667(n)/A064433(n) > A006667(m)/A064433(m) for all 0 < m < n.
A006667(n) is the number of tripling steps in the Collatz (3x+1) problem and A064433(n) is the number of halving steps in the Collatz (3x+1) problem.
It is crucial to make A006667(n) the numerator as it can be zero when n = 2^k for some k > 0.
a(n) is odd for all n > 1.
The corresponding ratios are:
0.0000000000000000000000000000... (2)
0.4000000000000000000000000000... (3)
0.4545454545454545454545454545... (7)
0.4615384615384615384615384615... (9)
0.5857142857142857142857142857... (27)
0.5899280575539568345323741007... (230631)
0.5924764890282131661442006269... (626331)
0.5927051671732522796352583586... (837799)
0.5931232091690544412607449856... (1723519)
0.5935828877005347593582887700... (3732423)
0.5937500000000000000000000000... (5649499)
0.5961538461538461538461538461... (6649279)
0.5967365967365967365967365967... (8400511)
0.6030405405405405405405405405... (63728127)
0.6035196687370600414078674948... (3743559068799)
If we define a "tripling step" to also include a "halving step" afterwards (since 3*n+1 converts an odd number n into an even number, so a halving step will always follow), the ratios are still maximum at the a(n) values. However, the ratios themselves are different. The corresponding ratios in this case are:
0.000000000000000000000000000... (2)
0.666666666666666666666666666... (3)
0.833333333333333333333333333... (7)
0.857142857142857142857142857... (9)
1.413793103448275862068965517... (27)
1.438596491228070175438596491... (230631)
1.453846153846153846153846153... (626331)
1.455223880597014925373134328... (837799)
1.457746478873239436619718309... (1723519)
1.460526315789473684210526315... (3732423)
1.461538461538461538461538461... (5649499)
1.476190476190476190476190476... (6649279)
1.479768786127167630057803468... (8400511)
1.519148936170212765957446808... (63728127)
1.656946826758147512864493997... (3743559068799)
From Jon E. Schoenfield, Nov 21 2015: (Start)
Let T and H be the number of tripling steps and halving steps, respectively, in the entire Collatz (3x+1) trajectory of a number n. Since each tripling step increases the value by a factor greater than 3, and each halving step decreases it by a factor of exactly 2, we have n * 3^T / 2^H < 1, from which T/H < log(2)/log(3) - log_3(n)/H, so the ratio T/H cannot exceed log(2)/log(3) = 0.6309297535...
It seems likely that the present sequence is a subsequence of A006877 (which consists of values n whose trajectories are of record length). Taking as values of n the terms from the b-file for A006877, and generating their trajectories to obtain the corresponding values of H(n), it does not seem clear whether log_3(n)/H(n) is converging toward zero or toward some positive limit, perhaps around 0.020 (which would mean T/H < log(2)/log(3) - 0.020, i.e., T/H < 0.611).
The known terms n in A006877 at which log_3(n)/H(n) reaches a record low coincide almost exactly with the known terms of this sequence, the only exception thus far being a(11) = A006877(52) = 5649499, at which log_3(n)/H(n) is only slightly larger than it is at a(10) = A006877(51) = 3732423 (0.03685302 vs. 0.03682956). Given the values of log_3(n)/H(n) for the remaining known terms in A006877, it seems likely that
a(16) = A006877(110) = 100759293214567
and that a(17) exceeds A006877(130), which is 46785696846401151.
(End)
Note that a(17)=104899295810901231 has now been found by Eric Roosendaal's distributed project (see link below). - Dmitry Kamenetsky, Sep 23 2016
For n>=14, a(n) must be 7, 15, 27, or 31 (mod 32). This is because all other values provably have a ratio of tripling to halving steps of less than 0.6 (see program by Irvine and Consiglio Jr.). - Dmitry Kamenetsky, Sep 24 2016

Crossrefs

Programs

  • PARI
    Tratio(n)=c=0; d=0; while(n!=1,if(n==Mod(0,2),n=n/2;d++); if(n==Mod(1,2)&&n!=1,n=3*n+1;c++));c/d
    print1(2,", "); n=2; p=Tratio(2); while(n,t=Tratio(n+1); if(p>=t,n+=2); if(p
    				

Extensions

Corrected and extended by Sean A. Irvine, Derek Orr, and David Consiglio, Jr., Nov 23 2015
a(16) from David Consiglio, Jr. and Sean A. Irvine, Nov 26 2015
a(17) added by Dmitry Kamenetsky, Sep 23 2016
Previous Showing 11-20 of 44 results. Next