login
A193688
Number of steps to reach 1 in Collatz (3x+1) problem starting with 2^n - 1.
4
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,2
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
MATHEMATICA
Table[Length[NestWhileList[If[OddQ@#, 3 # + 1, #/2] &, 2^n - 1, # > 1 &]] - 1, {n, 60}] (* Arkadiusz Wesolowski, Sep 16 2011 *)
PROG
(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
CROSSREFS
Cf. A000225, A006577, A179118 (starting with 2^n+1).
Sequence in context: A070417 A101681 A067776 * A132348 A177763 A101073
KEYWORD
nonn
AUTHOR
STATUS
approved