OFFSET
1,3
COMMENTS
If p is prime, a(p) = Sum_{d|p} (p-d) * phi(p/d) = (p-1) * phi(p) + (p-p) * phi(1) = (p-1)^2.
FORMULA
EXAMPLE
a(6) = Sum_{d|6} (6-d) * phi(6/d) = 5*phi(6) + 4*phi(3) + 3*phi(2) + 0*phi(1) = 5*2 + 4*2 + 3*1 + 0*1 = 21.
MAPLE
with(numtheory): seq(add((n-d)*phi(n/d), d in divisors(n)), n=1..80); # Ridouane Oudra, Jan 21 2024
MATHEMATICA
Table[Sum[(n - k)*EulerPhi[n/k^(1 - Ceiling[n/k] + Floor[n/k])] (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 80}]
PROG
(PARI) a(n) = sumdiv(n, d, (n-d) * eulerphi(n/d)); \\ Michel Marcus, May 21 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, May 20 2021
STATUS
approved