%I #41 Sep 08 2022 08:45:10
%S 1,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,
%T -2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,
%U 2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2,0
%N Expansion of (1+x)^2/(1+x^2).
%C Inverse binomial transform of A077860. Partial sums of A084100.
%C Transform of sqrt(1+2x)/sqrt(1-2x) (A063886) under the Chebyshev transformation A(x)->((1-x^2)/(1+x^2))*A(x/(1+x^2)). - _Paul Barry_, Oct 12 2004
%C Euler transform of length 4 sequence [2, -3, 0, 1]. - _Michael Somos_, Aug 04 2009
%H Colin Barker, <a href="/A084099/b084099.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,-1).
%F G.f.: (1+x)^2/(1+x^2).
%F a(n) = 2 * A101455(n) for n>0. - _N. J. A. Sloane_, Jun 01 2010
%F a(n+2) = (-1)^A180969(1,n)*((-1)^n - 1). - _Adriano Caroli_, Nov 18 2010
%F G.f.: 4*x + 2/(1+x)/G(0), where G(k) = 1 + 1/(1 - x*(2*k-1)/(x*(2*k+1) - 1/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, Jun 19 2013
%F From _Wesley Ivan Hurt_, Oct 27 2015: (Start)
%F a(n) = (1-sign(n)*(-1)^n)*(-1)^floor(n/2).
%F a(n) = 2*(n mod 2)*(-1)^floor(n/2) for n>0, a(0)=1.
%F a(n) = (1-(-1)^n)*(-1)^(n*(n-1)/2) for n>0, a(0)=1. (End)
%F From _Colin Barker_, Oct 27 2015: (Start)
%F a(n) = -a(n-2).
%F a(n) = i*((-i)^n-i^n) for n>0, where i = sqrt(-1).
%F (End)
%e G.f. = 1 + 2*x - 2*x^3 + 2*x^5 - 2*x^7 + 2*x^9 - 2*x^11 + 2*x^13 - 2*x^15 + ...
%p A084099:=n->(1-(-1)^n)*(-1)^((2*n-1+(-1)^n)/4): 1,seq(A084099(n), n=1..100); # _Wesley Ivan Hurt_, Oct 27 2015
%t CoefficientList[Series[(1+x)^2/(1+x^2),{x,0,110}],x] (* or *) Join[ {1}, PadRight[{},120,{2,0,-2,0}]] (* _Harvey P. Dale_, Nov 23 2011 *)
%o (PARI) {a(n) = if( n<1, n==0, 2 * if( n%2, (-1)^(n\2)) )}; /* _Michael Somos_, Aug 04 2009 */
%o (Magma) [1] cat [Integers()!((1-(-1)^n)*(-1)^(n*(n-1)/2)): n in [1..100]]; // _Wesley Ivan Hurt_, Oct 27 2015
%o (PARI) a(n) = if(n==0, 1, I*((-I)^n-I^n)) \\ _Colin Barker_, Oct 27 2015
%o (PARI) Vec((1+x)^2/(1+x^2) + O(x^100)) \\ _Colin Barker_, Oct 27 2015
%Y Cf. A063886, A077860, A084100, A101455, A180969.
%K sign,easy
%O 0,2
%A _Paul Barry_, May 15 2003