OFFSET
1,2
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{k=1..n} k * Sum_{d|k} (d^3 - (d - 1)^3)/d.
G.f.: (1/(1 - x)) * Sum_{k>=1} (k^3 - (k - 1)^3) * x^k/(1 - x^k)^2.
From Vaclav Kotesovec, Aug 03 2022: (Start)
a(n) ~ Pi^2*n^3/6 - 3*n^2*log(n)/2. (End)
MATHEMATICA
a[n_] := Sum[k * Floor[n/k]^3, {k, 1, n}]; Array[a, 40] (* Amiram Eldar, Dec 14 2021 *)
Accumulate[Table[(1 + 3*k)*DivisorSigma[1, k] - 3*k*DivisorSigma[0, k], {k, 1, 50}]] (* Vaclav Kotesovec, Dec 16 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, k*(n\k)^3);
(PARI) a(n) = sum(k=1, n, k*sumdiv(k, d, (d^3-(d-1)^3)/d));
(PARI) my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, (k^3-(k-1)^3)*x^k/(1-x^k)^2)/(1-x))
(Python)
from math import isqrt
def A350108(n): return -(s:=isqrt(n))**4*(s+1)+sum((q:=n//k)*(k**2*(3*(q+1))+k*(q*((q<<1)-3)-3)+q+1) for k in range(1, s+1))>>1 # Chai Wah Wu, Oct 31 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Dec 14 2021
STATUS
approved