%I #19 Jan 24 2021 11:16:46
%S 2,2,5,3,5,6,5,4,12,5,7,7,10,5,10,5,18,13,8,5,24,8,19,8,18,11,8,6,11,
%T 11,22,6,29,18,14,14,18,9,14,6,18,25,9,9,23,20,17,9,27,18,12,12,17,9,
%U 18,7,30,12,12,12,18,23,20,7,38,30,21,18,20,15,20,15
%N Number of halving and tripling steps to reach the last number of the cycle in the Collatz (3x+1) problem for the negative integers (the initial term is counted).
%F a(n) = A224183(n) + 1.
%e a(10) = 5 because the trajectory of -10 is -10 -> -5 -> -14 -> -7 -> -20 -> -10 and -10 is the last term of the cycle, hence 5 iterations where the first term -10 is counted.
%t Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, UnsameQ, All]; Table[s = Collatz[-n]; len = Length[s] - 2; If[s[[-1]] == 2, len = len - 1]; len+1, {n, 1, 100}]
%Y Cf. A006577, A224183.
%K nonn
%O 1,1
%A _Michel Lagneau_, Apr 01 2013
%E a(1) changed to 2 by _Pontus von Brömssen_, Jan 24 2021
|