login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A362024
The number of iterations of the infinitary totient function iphi (A064380) required to reach from n to 1.
2
1, 2, 3, 4, 3, 4, 4, 5, 5, 6, 5, 6, 5, 6, 7, 8, 7, 8, 7, 6, 6, 7, 6, 7, 8, 8, 9, 10, 7, 8, 8, 7, 7, 8, 9, 10, 7, 9, 8, 9, 9, 10, 9, 8, 11, 12, 8, 9, 9, 10, 10, 11, 7, 10, 9, 9, 11, 12, 8, 9, 9, 10, 9, 10, 8, 9, 11, 10, 9, 10, 8, 9, 9, 8, 10, 10, 10, 11, 11, 12
OFFSET
2,2
LINKS
FORMULA
a(n) = a(A064380(n)) + 1 for n > 2.
EXAMPLE
a(6) = 3 since there are 3 iterations from 6 to 1: iphi(6) = 3, iphi(3) = 2 and iphi(2) = 1.
MATHEMATICA
infCoprimeQ[n1_, n2_] := Module[{g = GCD[n1, n2]}, If[g == 1, True, AllTrue[FactorInteger[g][[;; , 1]], BitAnd @@ IntegerExponent[{n1, n2}, #] == 0 &]]];
iphi[n_] := Sum[Boole[infCoprimeQ[j, n]], {j, 1, n - 1}];
a[n_] := Length@ NestWhileList[iphi, n, # > 1 &] - 1;
Array[a, 100, 2]
PROG
(PARI) isinfcoprime(n1, n2) = {my(g = gcd(n1, n2), p, e1, e2); if(g == 1, return(1)); p = factor(g)[, 1]; for(i=1, #p, e1 = valuation(n1, p[i]); e2 = valuation(n2, p[i]); if(bitand(e1, e2) > 0, return(0))); 1; }
iphi(n) = sum(j = 1, n-1, isinfcoprime(j, n));
a(n) = if(n==2, 1, a(iphi(n)) + 1);
CROSSREFS
Cf. A064380, A362025 (indices of records).
Similar sequences: A003434, A049865, A333609.
Sequence in context: A059572 A031249 A031232 * A030583 A030563 A081399
KEYWORD
nonn
AUTHOR
Amiram Eldar, Apr 05 2023
STATUS
approved