A210516 The length-1 of the Collatz (3k+1) sequence for all odd fractions and integers.
0, 1, 2, 7, 3, 3, 2, 0, 3, 6, 5, 4, 15, 7, 5, 8, 9, 3, 11, 6, 7, 16, 1, 0, 8, 2, 7, 4, 3, 4, 16, 5, 7, 25, 4, 17, 19, 5, 13, 12, 6, 7, 17, 18, 8, 6, 7, 3, 0, 3, 22, 4, 3, 8, 31, 14, 10, 6, 9, 11, 26, 12, 19, 21, 32, 10, 9, 10, 1, 31, 8, 7, 18, 2, 8, 16, 11, 76
Offset: 1
Examples
The triangle of lengths begins 0; 1, 2; 7, 3, 3; 2, 0, 3, 6; 5, 4, 15, 7, 5; ... Individual numbers have the following Collatz sequences: [1] => [0] (0 iteration); [2 1/3] => [1, 2] because: 2 -> 1 => 1 iteration; 1/3 -> 2 -> 1 => 2 iterations; [3 2/3 1/5] => [7, 3, 3] because: 3->10->5->16->8->4->2->1 => 7 iterations; 2/3 -> 1/3 -> 2 -> 1 => 3 iterations; 1/5 -> 8/5 -> 4/5 -> 2/5 => 3 iterations.
Links
- Michel Lagneau, Rows n = 1..100, flattened
- J. C. Lagarias, The set of rational cycles for the 3x+1 problem, Acta Arith. 56 (1990), 33-53.
Programs
-
Mathematica
Collatz2[n_] := Module[{lst = NestWhileList[If[EvenQ[Numerator[#]], #/2, 3 # + 1] &, n, Unequal, All]}, If[lst[[-1]] == 1, lst = Drop[lst, -3], If[lst[[-1]] == 2, lst = Drop[lst, -2], If[lst[[-1]] == 4, lst = Drop[lst, -1], If[MemberQ[Rest[lst], lst[[-1]]], lst = Drop[lst, -1]]]]]]; t = Table[s = Collatz2[(n - k)/(2*k + 1)]; Length[s] - 1, {n, 12}, {k, 0, n - 1}]; Flatten[t] (* T. D. Noe, Jan 28 2013 *)
Comments