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 A334040 #45 Oct 17 2024 14:54:03 %S A334040 0,0,1,0,0,0,3,0,3,0,2,0,0,1,3,0,0,0,1,0,0,0,2,0,1,0,38,0,0,2,36,0,0, %T A334040 0,1,0,0,0,4,0,35,0,2,0,0,1,34,0,0,0,1,0,0,33,35,0,1,0,3,0,0,32,33,0, %U A334040 0,0,1,0,0,0,31,0,33,0,2,0,0,2,4,0,0,31,32 %N A334040 Number of odd numbers larger than n in the Collatz trajectory of n. %H A334040 Markus Sigg, <a href="/A334040/b334040.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Harvey P. Dale). %H A334040 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %e A334040 For n=7 the Collatz process is: 7,22,(11),34,(17),52,26,(13),40,20,10,5,16,8,4,2,1. The numbers in the parentheses are odd numbers in the Collatz process for n=7 that are bigger than 7. There are three of them, hence a(7)=3. %t A334040 Table[Count[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&],_?(#>n&&OddQ[#]&)],{n,90}] (* _Harvey P. Dale_, Aug 03 2023 *) %o A334040 (PARI) f(n) = if (n%2, 3*n+1, n/2); %o A334040 a(n) = {my(nb = 0, m=n); while ((n=f(n)) != 1, if ((n % 2) && (n>m), nb++)); nb;} \\ _Michel Marcus_, Jun 01 2020 %Y A334040 Cf. A006370, A006577, A070165, A078719, A286380 %K A334040 nonn %O A334040 1,7 %A A334040 _Hamid Kulosman_, May 11 2020