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.

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

This page as a plain text file.
%I A193688 #49 Feb 16 2025 08:33:15
%S A193688 0,7,16,17,106,107,46,47,61,62,156,157,158,159,129,130,224,225,177,
%T A193688 178,303,304,473,474,444,445,384,385,448,449,450,451,527,528,529,530,
%U A193688 531,532,533,534,535,536,586,587,588,589,590,591,592,593,594,595,852
%N A193688 Number of steps to reach 1 in Collatz (3x+1) problem starting with 2^n - 1.
%H A193688 Arkadiusz Wesolowski, <a href="/A193688/b193688.txt">Table of n, a(n) for n = 1..10000</a>
%H A193688 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CollatzProblem.html">Collatz Problem</a>
%H A193688 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%F A193688 For larger n, a(n) ~ 13.5*n.
%F A193688 a(n) = A006577(A000225(n)). - _Michel Marcus_, Jul 11 2023
%F A193688 a(2n) = 1 + a(2n-1) for n >= 2. - _Alexandre Herrera_, Jul 11 2023
%t A193688 Table[Length[NestWhileList[If[OddQ@#, 3 # + 1, #/2] &, 2^n - 1, # > 1 &]] - 1, {n, 60}] (* _Arkadiusz Wesolowski_, Sep 16 2011 *)
%o A193688 (Python)
%o A193688 for i in range(1, 100):
%o A193688     n = 2**i - 1
%o A193688     x = n
%o A193688     c = 0
%o A193688     while x != 1:
%o A193688         c = c + 1
%o A193688         if (x & 1) == 0:
%o A193688             x = x//2
%o A193688         else:
%o A193688             x = 3*x + 1
%o A193688     print(c)
%o A193688 # _David Rabahy_, Sep 18 2017
%Y A193688 Cf. A000225, A006577, A179118 (starting with 2^n+1).
%K A193688 nonn
%O A193688 1,2
%A A193688 _Arkadiusz Wesolowski_, Aug 02 2011