This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A224254 #15 Jan 24 2021 10:29:17 %S A224254 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 A224254 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 A224254 18,5,2,2,18,18,18,2,5,2,5,18,18,5,5,2,2,2,5,5 %N A224254 Full cycle lengths in the Collatz (3x+1) problem when the negative integers are used. %C A224254 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 A224254 Wikipedia, <a href="http://en.wikipedia.org/wiki/Collatz_conjecture">Collatz conjecture</a> %e A224254 a(1) = 2 because the cycle -1 -> -2 -> -1... contains 2 distinct terms; %e A224254 a(5) = 5 because the cycle -5 -> -14 -> -7->-20 -> -5 ... contains 5 distinct terms; %e A224254 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 A224254 (Python) %o A224254 import sympy %o A224254 def A224254(n): %o A224254 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 A224254 Cf. A121510, A224166, A224183. %K A224254 nonn %O A224254 1,1 %A A224254 _Michel Lagneau_, Apr 02 2013 %E A224254 Data corrected by _Pontus von Brömssen_, Jan 24 2021