OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n * (n + A018804(n))/2.
a(n) = (n/2) * (n + Sum_{d|n} phi(n/d) * d).
a(n) = (n/2) * Sum_{d|n} phi(n/d) * (d+1).
MATHEMATICA
a[n_] := Sum[k * GCD[k, n], {k, 1, n}]; Array[a, 50] (* Amiram Eldar, May 21 2021 *)
A344510[n_]:= (n/2)*DivisorSum[n, (#+1)*EulerPhi[n/#] &];
Table[A344510[n], {n, 60}] (* G. C. Greubel, Jun 24 2024 *)
PROG
(PARI) a(n) = sum(k=1, n, k*gcd(k, n));
(PARI) a(n) = n*sumdiv(n, d, eulerphi(n/d)*(d+1))/2;
(Magma)
A344510:= func< n | (n/2)*(&+[(d+1)*EulerPhi(Floor(n/d)): d in Divisors(n)]) >;
[A344510(n): n in [1..60]]; // G. C. Greubel, Jun 24 2024
(SageMath)
def A344510(n): return (n/2)*sum((k+1)*euler_phi(int(n//k)) for k in (1..n) if (k).divides(n))
[A344510(n) for n in range(1, 61)] # G. C. Greubel, Jun 24 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, May 21 2021
STATUS
approved