OFFSET
1,2
FORMULA
a(n) = Sum_{k=1..n} k * (1 - ceiling(n/phi(k)) + floor(n/phi(k))).
EXAMPLE
a(4) = 10: for the numbers 1..4, phi(1)=1|4, phi(2)=1|4, phi(3)=2|4, and phi(4)=2|4. Their sum is then 1+2+3+4 = 10.
MATHEMATICA
a[n_] := Sum[If[Divisible[n, EulerPhi[k]], k, 0], {k, 1, n}]; Array[a, 100] (* Amiram Eldar, Apr 22 2023 *)
PROG
(PARI) a(n) = sum(k=1, n, if (!(n % eulerphi(k)), k)); \\ Michel Marcus, Apr 22 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 21 2023
STATUS
approved