OFFSET
1,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
FORMULA
From Vaclav Kotesovec, May 28 2021: (Start)
a(n) ~ n^2 * (log(n) + 2*gamma - 1 - Pi^2/12), where gamma is the Euler-Mascheroni constant A001620. (End)
MAPLE
A024920:=n->add((n-k)*floor(n/k), k=1..n): seq(A024920(n), n=1..80); # Wesley Ivan Hurt, Apr 02 2017
MATHEMATICA
Table[Sum [(n - k) Floor[n/k], {k, n}], {n, 51}] (* Michael De Vlieger, Apr 03 2017 *)
Table[Sum[n*DivisorSigma[0, k] - DivisorSigma[1, k], {k, 1, n}], {n, 1, 50}] (* Vaclav Kotesovec, May 28 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, (n-k)*floor(n/k)) \\ Michel Marcus, Mar 23 2013
(Python)
from math import isqrt
def A024920(n): return (s:=isqrt(n))**2*(s+1-(n<<1))+sum((q:=n//k)*((n<<2)-(k<<1)-q-1) for k in range(1, s+1))>>1 # Chai Wah Wu, Oct 23 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved