OFFSET
1,2
LINKS
Sebastian Karlsson, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n*Sum_{k=1..n-1} k*(n-k)/gcd(n,k)^2.
a(n) = (1/6)*n*Sum_{d|n} d*(d*phi(d) - A023900(d)).
a(p^e) = (1/6)*p^(e+1)*(p^e-1)*(p^(e+1) + p^(2*e+1) + p^2 + 2*p + 1)/(p^2 + p + 1).
a(prime(n)) = A138421(n). - Michel Marcus, Jan 20 2021
MATHEMATICA
a[n_] := Sum[LCM[LCM[n, k], LCM[n, n - k]], {k, 1, n - 1}];
Table[a[n], {n, 1, 40}] (* Robert P. P. McKone, Jan 18 2021 *)
PROG
(Python)
from math import gcd
for n in range(1, 41):
print(n*sum([k*(n-k)//(gcd(n, k)**2) for k in range(1, n)]), end=', ')
(PARI) a(n) = sum(k=1, n-1, lcm(lcm(n, k), lcm(n, n-k))); \\ Michel Marcus, Jan 18 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Sebastian Karlsson, Jan 18 2021
STATUS
approved