login
A344510
a(n) = Sum_{k=1..n} k * gcd(k,n).
2
1, 5, 12, 24, 35, 63, 70, 112, 135, 185, 176, 312, 247, 371, 450, 512, 425, 729, 532, 920, 903, 935, 782, 1488, 1125, 1313, 1458, 1848, 1247, 2475, 1426, 2304, 2277, 2261, 2660, 3672, 2035, 2831, 3198, 4400, 2501, 4977, 2752, 4664, 5265, 4163, 3290, 6912, 4459, 6125, 5508, 6552
OFFSET
1,2
LINKS
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