OFFSET
1,2
COMMENTS
In general, for m>=1, Sum_{k=1..n} k^m * tau(k) = Sum_{k=1..n} k^m * (Bernoulli(m+1, floor(1 + n/k)) - Bernoulli(m+1, 0)) / (m+1), where Bernoulli(n,x) are the Bernoulli polynomials. - Daniel Suteu, Nov 08 2018
FORMULA
a(n) ~ n^3 * (log(n) + 2*gamma - 1/3)/3, where gamma is the Euler-Mascheroni constant A001620.
a(n) = Sum_{k=1..n} k^2 * Bernoulli(3, floor(1 + n/k)) / 3, where Bernoulli(n,x) are the Bernoulli polynomials. - Daniel Suteu, Nov 08 2018
a(n) = Sum_{k=1..n} Sum_{i=1..floor(n/k)} i^2 * k^2. - Wesley Ivan Hurt, Nov 26 2020
MATHEMATICA
Accumulate[Table[k^2*DivisorSigma[0, k], {k, 1, 50}]]
PROG
(PARI) a(n) = sum(k=1, n, k^2*numdiv(k)); \\ Michel Marcus, Sep 12 2018
(PARI) f(n) = n*(n+1)*(2*n+1)/6; \\ A000330
a(n) = 2*sum(k=1, sqrtint(n), k^2 * f(n\k)) - f(sqrtint(n))^2; \\ Daniel Suteu, Nov 26 2020
(Python)
from math import isqrt
def A319085(n): return (-((s:=isqrt(n))*(s+1)*(2*s+1))**2//12 + sum(k**2*(q:=n//k)*(q+1)*(2*q+1) for k in range(1, s+1)))//3 # Chai Wah Wu, Oct 21 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Vaclav Kotesovec, Sep 10 2018
STATUS
approved