OFFSET
1,2
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
FORMULA
MATHEMATICA
a[n_] := Sum[k * Floor[n/k]^2, {k, 1, n}]; Array[a, 50] (* Amiram Eldar, Dec 14 2021 *)
Accumulate[Table[2*k*DivisorSigma[0, k] - DivisorSigma[1, k], {k, 1, 100}]] (* Vaclav Kotesovec, Dec 16 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, k*(n\k)^2);
(PARI) a(n) = sum(k=1, n, k*sumdiv(k, d, (2*d-1)/d));
(PARI) my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, (2*k-1)*x^k/(1-x^k)^2)/(1-x))
(PARI) a(n) = sum(k=1, n, 2*k*numdiv(k)-sigma(k));
(Python)
from math import isqrt
def A350107(n): return -(s:=isqrt(n))**3*(s+1)+sum((q:=n//k)*((k<<1)*((q<<1)+1)-q-1) for k in range(1, s+1))>>1 # Chai Wah Wu, Oct 24 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Dec 14 2021
STATUS
approved