A212653 Number of steps to reach 1 in the Collatz (3x+1) problem starting with 3^n + 1.
1, 2, 6, 18, 110, 21, 95, 32, 75, 74, 42, 134, 133, 132, 131, 143, 204, 128, 189, 139, 94, 93, 260, 427, 90, 257, 393, 330, 254, 253, 389, 388, 387, 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, 500, 499, 449, 497, 496, 751, 494, 493, 492, 747, 490, 745
Offset: 0
Keywords
Examples
a(2) = 6 because 3^2 + 1 = 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 with 6 iterations.
Links
- Harvey P. Dale, Table of n, a(n) for n = 0..1000
- Wikipedia, Collatz conjecture
Programs
-
Mathematica
f[n_] := Module[{a=3^n+1, k=0}, While[a!=1, k++; If[EvenQ[a], a=a/2, a=a*3+1]]; k]; Table[f[n], {n, 100}] Table[Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,3^n+1,#!=1&]]-1,{n,0,60}] (* Harvey P. Dale, Sep 26 2015 *)
Formula
a(n) = A075487(n) - 1.
Comments