OFFSET
1,3
FORMULA
G.f.: 1/(1-x) * Sum_{k>=1} x^(2*k)/(1-x^k)^3 = 1/(1-x) * Sum_{k>=2} binomial(k,2) * x^k/(1-x^k).
PROG
(PARI) a(n) = sum(k=2, n, binomial(k, 2)*(n\k));
(Python)
from math import isqrt
def A366967(n): return ((s:=isqrt(n))**2*(1-s**2)+sum((q:=n//k)*(3*k*(k-1)+q**2-1) for k in range(1, s+1)))//6 # Chai Wah Wu, Oct 30 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Oct 30 2023
STATUS
approved