A320538 Assuming the truth of the Collatz conjecture, a(n) is the number of divisors of n appearing in the Collatz trajectory of n.
1, 2, 2, 3, 2, 4, 2, 4, 2, 4, 2, 6, 2, 4, 3, 5, 2, 4, 2, 6, 2, 4, 2, 8, 3, 4, 2, 6, 2, 6, 2, 6, 3, 4, 3, 6, 2, 4, 3, 8, 2, 4, 2, 6, 3, 4, 2, 10, 3, 6, 3, 6, 2, 4, 3, 8, 2, 4, 2, 9, 2, 4, 2, 7, 4, 6, 2, 6, 2, 6, 2, 8, 2, 4, 2, 6, 3, 6, 2, 10, 2, 4, 2, 6, 2, 4, 2
Offset: 1
Keywords
Examples
a(6) = 4 because the Collatz trajectory 6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 contains 4 divisors of 6: 1, 2, 3 and 6.
Links
Programs
-
Mathematica
lst={}; coll[n_]:=NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&]; Do[AppendTo[lst,Length[Intersection[Divisors[n],coll[n]]]],{n,1,100}]; lst
-
PARI
f(n) = if(n%2, 3*n+1, n/2); a(n) = {my(kn = n, nb = 1); while (n != 1, n = f(n); if ((kn % n) == 0, nb++);); nb;}
Comments