login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A366938
a(n) = Sum_{k=1..n} (-1)^(k-1) * binomial(k+2,3) * floor(n/k).
3
1, -2, 9, -14, 22, -27, 58, -85, 91, -97, 190, -243, 213, -266, 460, -499, 471, -553, 778, -970, 896, -845, 1456, -1697, 1264, -1560, 2270, -2289, 2207, -2307, 3150, -3793, 3049, -3125, 4765, -5079, 4061, -4492, 6634, -6714, 5628, -6370, 7821, -9120, 7986, -7013
OFFSET
1,2
FORMULA
G.f.: 1/(1-x) * Sum_{k>=1} x^k/(1+x^k)^4 = -1/(1-x) * Sum_{k>=1} binomial(k+2,3) * (-x)^k/(1-x^k).
PROG
(PARI) a(n) = sum(k=1, n, (-1)^(k-1)*binomial(k+2, 3)*(n\k));
(Python)
from math import isqrt
def A366938(n): return (((s:=isqrt(m:=n>>1))*(s+1)**3*(s+2)<<4)-(t:=isqrt(n))*(t+1)**2*(t+2)*(t+3)-sum((((q:=m//w)+1)*(q*(q+1)*(q+2)+(w*(w+1)*((w<<1)+1)<<1))<<4) for w in range(1, s+1))+sum(((q:=n//w)+1)*(q*(q+2)*(q+3)+(w*(w+1)*(w+2)<<2)) for w in range(1, t+1)))//24 # Chai Wah Wu, Oct 29 2023
CROSSREFS
Partial sums of A320901.
Sequence in context: A242466 A071344 A224855 * A254608 A324275 A106360
KEYWORD
sign
AUTHOR
Seiichi Manyama, Oct 29 2023
STATUS
approved