%I #15 Jan 24 2021 10:29:17
%S 2,2,2,2,5,2,5,2,5,5,2,2,5,5,2,2,18,5,5,5,18,2,18,2,18,5,5,5,2,2,18,2,
%T 18,18,5,5,18,5,2,5,18,18,2,2,18,18,5,2,18,18,5,5,2,5,18,5,2,2,2,2,18,
%U 18,5,2,2,18,18,18,2,5,2,5,18,18,5,5,2,2,2,5,5
%N Full cycle lengths in the Collatz (3x+1) problem when the negative integers are used.
%C There are other cycles of lengths 2, 5 and 18 if negative integers are used. In Z, it is conjectured that the five values of cycle are 1, 2, 3, 5 and 18 (see A121510).
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Collatz_conjecture">Collatz conjecture</a>
%e a(1) = 2 because the cycle -1 -> -2 -> -1... contains 2 distinct terms;
%e a(5) = 5 because the cycle -5 -> -14 -> -7->-20 -> -5 ... contains 5 distinct terms;
%e a(17) = 18 because the cycle -17 -> -50 -> -25->-74 -> -37 -> -110 -> -55->-164 -> -82 -> -41 -> -122->-61 -> -182 -> -91 -> -272->-136 -> -68 -> -34 -> -17... contains 18 distinct terms.
%o (Python)
%o import sympy
%o def A224254(n):
%o return next(sympy.cycle_length(lambda x:3*x+1 if x%2 else x//2,-n))[0] # _Pontus von Brömssen_, Jan 24 2021
%Y Cf. A121510, A224166, A224183.
%K nonn
%O 1,1
%A _Michel Lagneau_, Apr 02 2013
%E Data corrected by _Pontus von Brömssen_, Jan 24 2021