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

A277109 Starting from 2^n+1, the length of the longest sequence of consecutive numbers which all take the same number of steps to reach 1 in the Collatz (or '3x+1') problem.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 7, 15, 30, 1, 1, 3, 7, 15, 26, 26, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 7, 15, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 3, 1, 3, 7, 15, 1, 1, 3, 7, 15, 26, 1, 3, 7, 15, 31, 63, 26, 30, 26, 26, 26, 26, 30, 46, 26, 26, 26, 26, 1, 1, 1, 3, 7, 15, 1, 3, 1
Offset: 0

Views

Author

Dmitry Kamenetsky, Sep 30 2016

Keywords

Comments

a(500) was found by Guo-Gang Gao (see links).
Interestingly, this sequence has many sets of consecutive terms that are increasing powers of 2 minus 1. For example: a(291) to a(307), a(447) to a(467), and a(603) to a(625). It is not clear why this is the case.
The largest value known in this sequence is a(3951) = 2^47-1 = 140737488355327.
Conjecture: If a(n) = 2^k - 1 for some k > 1, then a(n-1) = 2^(k-1) - 1. Conjecture holds for n <= 1812.
From Hartmut F. W. Hoft, Aug 16 2018: (Start)
The conjecture is true. Let the lengths of the Collatz runs equal q for all numbers 2^n + 1, 2^n + 2, 2^n + 3, 2^n + 4, ..., 2^n + 2^k - 2, 2^n + 2^k - 1. Then dividing the 2^(k-1) - 1 even numbers by two gives rise to the sequence 2^(n-1) + 1, 2^(n-1) + 2, ..., 2^(n-1) + 2^(k-1) - 1 of numbers for which the lengths of the Collatz runs equals q-1. Furthermore, let the length of the Collatz run of 2^n + 2^k be r != q then the length of the Collatz run of 2^(n-1) + 2^(k-1) is r-1 != q-1, i.e., a(n-1) = 2^(k-1) - 1.
Conjecture: Let a(k), ..., a(k+m), m >= 0, be a subsequence of this sequence such that a(k)=a(k+m+1)=1 and a(k+i) > 1, 1 <= i <= m. Then the lengths of the Collatz runs of a(k+i), 0 <= i <= m, increase by 1. In addition, there is an initial segment of increasing numbers a(k), ..., a(k+j), for some 0 <= j <= m, in each such subsequence having the form 2^i - 1, 0 < i <= j. (End)

Examples

			a(6) = 3, because 2^6+1, 2^6+2 and 2^6+3 all take 27 steps to reach 1.
From _Hartmut F. W. Hoft_, Aug 16 2018: (Start)
Two examples for the conjecture (L(n) denotes the length of the Collatz run):
n      a(n)    L(n)          n      a(n)    L(n)
64     26      483           20      1       72
------------------           ------------------
65      1      559           21      1      166
66      3      560           22      3      167
67      7      561           23      7      168
68     15      562           24     15      169
69     31      563           ------------------
70     63      564           25     26      170
------------------           26     26      171
71     26      565           ------------------
72     30      566           27      1      247
73     26      567
74     26      568
75     26      569
76     26      570
77     30      571
78     46      572
79     26      573
80     26      574
81     26      575
82     26      576
------------------
83      1      626
The "power of 2 minus 1" initial section of any such subsequence of a(n) is always increasing. However, there is no apparent ordering in the second section when that is present. (End)
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Length[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # != 1 &]] - 1; Table[k = 1; While[f[2^n + k] == f[2^n + k + 1], k++]; k, {n, 120}] (* Michael De Vlieger, Oct 03 2016 *)
  • PARI
    nbsteps(n)= s=n; c=0; while(s>1, s=if(s%2, 3*s+1, s/2); c++); c;
    a(n) = {my(ns = 2^n+1); my(nbs = nbsteps(ns)); while(nbsteps(ns+1) == nbs, ns++); ns - 2^n;} \\ Michel Marcus, Oct 30 2016

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

Original entry on oeis.org

0, 7, 16, 17, 106, 107, 46, 47, 61, 62, 156, 157, 158, 159, 129, 130, 224, 225, 177, 178, 303, 304, 473, 474, 444, 445, 384, 385, 448, 449, 450, 451, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 852
Offset: 1

Views

Author

Arkadiusz Wesolowski, Aug 02 2011

Keywords

Crossrefs

Cf. A000225, A006577, A179118 (starting with 2^n+1).

Programs

  • Mathematica
    Table[Length[NestWhileList[If[OddQ@#, 3 # + 1, #/2] &, 2^n - 1, # > 1 &]] - 1, {n, 60}] (* Arkadiusz Wesolowski, Sep 16 2011 *)
  • Python
    for i in range(1, 100):
        n = 2**i - 1
        x = n
        c = 0
        while x != 1:
            c = c + 1
            if (x & 1) == 0:
                x = x//2
            else:
                x = 3*x + 1
        print(c)
    # David Rabahy, Sep 18 2017

Formula

For larger n, a(n) ~ 13.5*n.
a(n) = A006577(A000225(n)). - Michel Marcus, Jul 11 2023
a(2n) = 1 + a(2n-1) for n >= 2. - Alexandre Herrera, Jul 11 2023

A330591 Number of Collatz steps to reach 1 starting from 6^n + 1.

Original entry on oeis.org

16, 21, 26, 101, 83, 83, 145, 145, 220, 158, 145, 207, 114, 114, 450, 114, 357, 357, 282, 419, 419, 494, 494, 494, 494, 494, 494, 494, 543, 494, 543, 799, 799, 543, 543, 799, 543, 543, 799, 799, 791, 791, 791, 791, 861, 861, 861, 861, 998, 998, 998, 861, 861, 861
Offset: 1

Views

Author

Aranya Kumar Bal, Dec 18 2019

Keywords

Comments

The Collatz transform maps any positive integer k to k/2 if k is even or 3*k+1 if k is odd. There is a famous unsolved problem which says that, starting with any positive integer k, repeated application of the Collatz transform will eventually reach 1 or equivalently enter the cycle (4,2,1).
This sequence is related to A179118 and A212653, which look at the stopping times of numbers of the form 2^n+1 and 3^n+1 respectively. We note that there exist several sequences of arithmetic progressions with common difference 1 in the former and with common difference -1 in the latter. This sequence looks at stopping times of numbers of the form 2^n*3^n+1 where we see that there exist arithmetic progressions with common difference 1+(-1)=0. This is an interesting result that requires further investigation.

Examples

			a(2)=21 because the Collatz trajectory of 6^2 + 1 = 37 is
  37 -> 112 -> 56 -> 28 -> 14 ->  7 -> 22 ->
  11 ->  34 -> 17 -> 52 -> 26 -> 13 -> 40 ->
  20 ->  10 ->  5 -> 16 ->  8 ->  4 ->  2 ->  1, which is 21 steps.
		

Crossrefs

Programs

  • Mathematica
    n=200;
    For [j=1, j
    				
  • PARI
    nbsteps(n) = if(n<0, 0, my(s=n, c=0); while(s>1, s=if(s%2, 3*s+1, s/2); c++); c); \\ A006577
    a(n) = nbsteps(6^n+1); \\ Michel Marcus, Dec 21 2019
  • Python
    from decimal import *
    n=1000
    for j in range(2,n):
      i=6**j+1
      count=0
      while(i!=1):
        if(i%2==0):
          i=i//2
        else:
          i=3*i+1
        count=count+1
      print(count)
    

Formula

a(n) = A006577(6^n+1).
Showing 1-3 of 3 results.