A193688 Number of steps to reach 1 in Collatz (3x+1) problem starting with 2^n - 1.
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
Keywords
Links
- Arkadiusz Wesolowski, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Collatz Problem
- Index entries for sequences related to 3x+1 (or Collatz) problem
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(2n) = 1 + a(2n-1) for n >= 2. - Alexandre Herrera, Jul 11 2023