OFFSET
0,4
COMMENTS
FORMULA
EXAMPLE
a(3) = -2 - 3 = -5.
a(4) = -5 - 3 = -8.
a(5) = 16 + 21 + 24 = 61.
a(6) = 61 + 45 + 24 = 130.
a(7) = -272 - 333 - 378 - 402 = -1385.
PROG
(PARI) {b(n) = local(v=[1], t); if( n<0, 0, for(k=2, n+2, t=0; v = vector(k, i, if( i>1, t+= v[k+1-i]))); v[2])}; \\ Michael Somos's PARI program for A000111
c(n) = if(n==0, 0, (-1)^(n+floor(n/2))*b(n))
a(n) = sum(k=0, floor(n/2), sum(i=0, n-k, binomial(n-k, i)*(-1)^(k+i)*c(k+i)))
CROSSREFS
KEYWORD
sign
AUTHOR
Petros Hadjicostas, Mar 04 2021
STATUS
approved