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