OFFSET
1,3
LINKS
FORMULA
a(n) = Sum_{i=1..floor(n/2)} i * (n-i) * (floor((n-i)/i) - floor((n-i-1)/i)).
a(n) = Sum_{d|n} d*(n-d). - Daniel Suteu, Jun 19 2018
a(n) = n*sigma(n) - sigma_2(n). - Ridouane Oudra, Apr 15 2021
From Amiram Eldar, Dec 11 2023: (Start)
Sum_{k=1..n} a(k) ~ c * n^3 / 3, where c = zeta(2) - zeta(3) = 0.442877... . (End)
MAPLE
with(numtheory): seq(n*sigma(n) - sigma[2](n), n=1..60); # Ridouane Oudra, Apr 15 2021
MATHEMATICA
Table[Sum[i (n - i) (Floor[(n - i)/i] - Floor[(n - i - 1)/i]), {i, Floor[n/2]}], {n, 80}]
a[n_] := n * DivisorSigma[1, n] - DivisorSigma[2, n]; Array[a, 100] (* Amiram Eldar, Dec 11 2023 *)
PROG
(Magma) [0] cat [&+[k*(n-k)*((n-k) div k)-(n-k-1) div k: k in [1..n div 2]]: n in [2..80]]; // Vincenzo Librandi, Jun 07 2018
(PARI) a(n) = sum(i=1, n\2, i*(n-i)*((n-i)\i - (n-i-1)\i)); \\ Michel Marcus, Jun 07 2018
(PARI) a(n) = sumdiv(n, d, d*(n-d)); \\ Daniel Suteu, Jun 19 2018
(PARI) a(n) = {my(f = factor(n)); n * sigma(f) - sigma(f, 2); } \\ Amiram Eldar, Dec 11 2023
(GAP) List([1..60], n->Sum([1..Int(n/2)], i->i*(n-i)*(Int((n-i)/i)-Int((n-i-1)/i)))); # Muniru A Asiru, Jun 07 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 22 2018
STATUS
approved