OFFSET
1,2
FORMULA
Multiplicative with a(p^e) = p^(e-1) * ((p + 1) * p^e - 2).
a(n) = Sum_{k=1..n, gcd(n,k) = 1} gcd(n,k-1)^2.
a(n) = Sum_{k=1..n} uphi(gcd(n,k)^2).
a(n) = Sum_{d|n} phi(n/d) * uphi(d^2).
Sum_{k=1..n} a(k) ~ c * n^3, where c = (Pi^2/18) * Product_{p prime} (1 - 2/p^3 + 1/p^4) = 0.4083249979... . - Amiram Eldar, Nov 05 2022
MATHEMATICA
Table[EulerPhi[n^2] DivisorSum[n, 2^PrimeNu[#]/# &], {n, 50}]
f[p_, e_] := p^(e - 1) ((p + 1) p^e - 2); a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 50]
PROG
(PARI) a(n) = eulerphi(n^2)*sumdiv(n, d, 2^omega(d)/d); \\ Michel Marcus, Sep 24 2021
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Ilya Gutkovskiy, Sep 24 2021
STATUS
approved