OFFSET
1,2
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{k=1..n} k^2 * Sum_{d|k} (2*d - 1)/d^2 = Sum_{k=1..n} 2 * k * sigma(k) - sigma_2(k) = 2 * A143128(n) - A064602(n).
G.f.: (1/(1 - x)) * Sum_{k>=1} (2*k - 1) * x^k * (1 + x^k)/(1 - x^k)^3.
a(n) ~ n^3 * (Pi^2/9 - zeta(3)/3). - Vaclav Kotesovec, Dec 16 2021
MATHEMATICA
Accumulate[Table[2*k*DivisorSigma[1, k] - DivisorSigma[2, k], {k, 1, 50}]] (* Vaclav Kotesovec, Dec 16 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, k^2*(n\k)^2);
(PARI) a(n) = sum(k=1, n, k^2*sumdiv(k, d, (2*d-1)/d^2));
(PARI) a(n) = sum(k=1, n, 2*k*sigma(k)-sigma(k, 2));
(PARI) my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, (2*k-1)*x^k*(1+x^k)/(1-x^k)^3)/(1-x))
(Python)
from math import isqrt
def A350123(n): return (-(s:=isqrt(n))**3*(s+1)*((s<<1)+1)+sum((q:=n//k)*(6*k**2*q+((k<<1)-1)*(q+1)*((q<<1)+1)) for k in range(1, s+1)))//6 # Chai Wah Wu, Oct 24 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Dec 15 2021
STATUS
approved