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 A213181 #24 May 01 2025 17:38:42 %S A213181 0,0,1,1,1,1,3,1,4,1,3,2,2,3,2,1,3,4,4,2,1,3,2,2,5,2,17,4,4,2,16,1,6, %T A213181 3,2,5,4,4,6,2,17,1,6,4,4,2,16,2,5,5,5,3,2,17,17,4,7,4,6,3,3,16,15,1, %U A213181 6,6,5,4,3,2,16,5,18,4,2,5,5,6,6,2,4,17,17 %N A213181 Number of chains of even numbers of length 2 or more in the Collatz (3x+1) trajectory of n. %C A213181 A pair of even numbers that appear side by side in Collatz trajectory of n is considered a chain of length 2 and likewise for chains of greater length. %H A213181 T. D. Noe, <a href="/A213181/b213181.txt">Table of n, a(n) for n = 1..10000</a> %F A213181 a(n) = a(A363270(A014682(n))) + 1 for n >= 3. - _Alan Michael Gómez Calderón_, Apr 09 2025 %F A213181 a(n) = a(A139391(n)) + A133872(n) for n >= 2. - _Alan Michael Gómez Calderón_, Apr 23 2025 %e A213181 For n=3, Collatz trajectory of 3 is 3,10,5,16,8,4,2,1, hence the only chain is 16,8,4,2 and so a(3)=1. %e A213181 For n=12: 12,6,3,10,5,16,8,4,2,1 and as such there are two chains 12,6 and 16,8,4,2 so a(12)=2. %t A213181 Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[c = Collatz[n]; cnt = 0; evenCnt = 0; Do[If[OddQ[i], evenCnt = 0, evenCnt++; If[evenCnt == 2, cnt++]], {i, c}]; cnt, {n, 100}] (* _T. D. Noe_, Feb 28 2013 *) %Y A213181 Cf. A014682, A070165, A133872, A139391, A363270. %K A213181 nonn %O A213181 1,7 %A A213181 _Jayanta Basu_, Feb 28 2013