A084100 Expansion of (1+x-x^2-x^3)/(1+x^2).
1, 1, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2
Offset: 0
Examples
G.f. = 1 + x - 2*x^2 - 2*x^3 + 2*x^4 + 2*x^5 - 2*x^6 - 2*x^7 + 2*x^8 + 2*x^9 + ...
Links
- Index entries for linear recurrences with constant coefficients, signature (0,-1).
Programs
-
Mathematica
CoefficientList[Series[(1+x-x^2-x^3)/(1+x^2),{x,0,100}],x] (* Harvey P. Dale, Apr 20 2011 *) a[ n_] := (-1)^Quotient[n, 2] If[ Quotient[n, 2] != 0, 2, 1]; (* Michael Somos, Jan 05 2017 *)
-
PARI
{a(n) = (-1)^(n\2) * if( n\2, 2, 1)}; /* Michael Somos, Jan 05 2017 */
Formula
Euler transform of length 4 sequence [1, -3, 0, 1]. - Michael Somos, Jan 05 2017
G.f.: (1 + x) * (1 - x^2) / (1 + x^2). - Michael Somos, Jan 05 2017
a(n) = a(1-n) for all n in Z. - Michael Somos, Jan 05 2017
a(2*n) = a(2*n + 1) = A280560(n) for all n in Z. - Michael Somos, Jan 05 2017
Comments