|
|
A098554
|
|
G.f.: x*(1-x^2)/((1+x^2)*(1+x+x^2)).
|
|
4
|
|
|
0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
LINKS
|
|
|
FORMULA
|
Let b(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*(0^(n-2k)-(-1)^(n-2k)). Then a(n) = b(n) - b(n-2), or a(n) = Sum_{j=0..n} b(n-j)*(binomial(1, j/2)*(-1)^(j/2)*(1+(-1)^j)/2). The g.f. is obtained from the g.f. x/(1+x) of 0^n-(-1)^n by applying the transformation G(x)->((1-x^2)/(1+x^2))G(x/(1+x^2)). - Paul Barry, Oct 26 2004
a(0)=0, a(1)=1, a(2)=-1, a(3)=-2, a(n) = a(n-1) - 2*a(n-2) - a(n-3) - a(n-4). - Harvey P. Dale, Jan 16 2016
|
|
MATHEMATICA
|
CoefficientList[Series[x*(1-x^2)/((1+x^2)*(1+x+x^2)), {x, 0, 110}], x] (* or *) LinearRecurrence[{-1, -2, -1, -1}, {0, 1, -1, -2}, 110] (* Harvey P. Dale, Jan 16 2016 *)
|
|
PROG
|
(PARI) x='x+O('x^30); concat([0], Vec(x*(1-x^2)/((1+x^2)*(1+x+x^2)))) \\ G. C. Greubel, Jan 17 2018
(Magma) I:=[0, 1, -1, -2]; [n le 4 select I[n] else -Self(n-1) - 2*Self(n-2) -Self(n-3) - Self(n-4): n in [1..30]]; // G. C. Greubel, Jan 17 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|