A224361 The length of the Collatz (3k+1) sequence for all odd negative fractions and integers.
1, 2, 2, 5, 3, 5, 3, 1, 6, 10, 5, 4, 8, 11, 5, 6, 4, 7, 12, 6, 9, 5, 2, 1, 12, 2, 10, 15, 4, 7, 9, 14, 7, 9, 16, 5, 12, 5, 10, 13, 4, 11, 6, 6, 18, 5, 5, 8, 1, 3, 12, 17, 5, 19, 37, 7, 5, 15, 13, 5, 10, 17, 7, 10, 38, 14, 7, 6, 2, 17, 8, 14, 7, 2, 20, 17, 15
Offset: 1
Examples
The triangle of lengths begins 1; 2, 2; 5, 3, 5; 3, 1, 6, 10; 5, 4, 8, 11, 5; ... Individual numbers have the following Collatz sequences (including the first term): [-1] => [1] because -1 -> -1 with 1 iteration; [-2 -1/3] => [2, 2] because: -2 -> -1 => 2 iterations; -1/3 -> 0 => 2 iterations; [-3 -2/3 -1/5] => [5, 3, 5] because: -3 -> -8 -> -4 -> -2 -> -1 => 5 iterations; -2/3 -> -1/3 -> 0 => 3 iterations; -1/5 -> 2/5 -> 1/5 -> 8/5 -> 4/5 => 5 iterations.
Programs
-
Mathematica
Collatz2[n_] := Module[{lst = NestWhileList[If[EvenQ[Numerator[#]], #/2, 3 # + 1] &, n, Unequal, All]}, If[lst[[-1]] == -1, lst = Drop[lst, -2], 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], {n, 13}, {k, 0, n - 1}]; Flatten[t] (* program from T. D. Noe, adapted for this sequence - see A210688 *)
Formula
a(n) = A224360(n) + 1.
Comments