OFFSET
1,3
COMMENTS
This is the function phi(n, 3) defined in Alder because:
if phi(n, 2)/phi(n, 2) =: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
then phi(n, 3)/phi(n, 2) =: 1, 1, 2/1, 1, 1, 2/1, 1, 1, 2/1, 1, 1, 2/1, 1, 1, 2/1, ...
phi(n, 5)/phi(n, 2) =: 1, 1, 1, 1, 4/3, 1, 1, 1, 1, 4/3, 1, 1, 1, 1, 4/3, ...
phi(n, 7)/phi(n, 2) =: 1, 1, 1, 1, 1, 1, 6/5, 1, 1, 1, 1, 1, 1, 6/5, 1, ...
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..10000
Henry L. Alder, A Generalization of the Euler phi-Function, The American Mathematical Monthly, Vol. 65, No. 9 (Nov., 1958), pp. 690-692.
FORMULA
Also, A000010(A000079(n)) = A002472(A000079(n)), A000010(A003586(n)) = a(A003586(n)), A000010(A003592(n)) = A390470(A003592(n)), ...
From Amiram Eldar, Nov 03 2025: (Start)
Multiplicative with a(2^e) = 2^(e-1), a(3^e) = 2*3^(e-1), and a(p^e) = (p-2)*p^(e-1) for p >= 5.
Dirichlet g.f.: zeta(s-1) * ((1-1/2^s)*(1-1/3^s))/((1-1/2^(s-1))*(1-2/3^s)) * Product_{p prime} (1 - 2/p^s).
Sum_{k=1..n} a(k) ~ c * n^2, where c = (6/7) * Product_{p prime} (1 - 2/p^2) = (6/7) * A065474 = 0.2765435133... . (End)
MATHEMATICA
f[p_, e_] := If[p == 3, 2, 1] * If[p == 2, p^(e - 1), (p - 2)*p^(e - 1)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 03 2025 *)
PROG
(Magma) [#[z: z in [1..n] | Gcd(z^2 - 9, n) eq 1]: n in [1..81]];
(PARI) a(n) = {my(f = factor(n), p, e); prod(i = 1, #f~, p = f[i, 1]; e = f[i, 2]; if(p == 2, p^(e-1), if(p == 3, 2*(p-2)*p^(e-1), (p-2)*p^(e-1)))); } \\ Amiram Eldar, Nov 03 2025
CROSSREFS
KEYWORD
nonn,mult,easy
AUTHOR
Juri-Stepan Gerasimov, Oct 31 2025
STATUS
approved
