%I #9 Jun 13 2015 00:51:38
%S 1,1,-1,-2,1,3,-2,-5,5,10,-11,-21,22,43,-43,-86,85,171,-170,-341,341,
%T 682,-683,-1365,1366,2731,-2731,-5462,5461,10923,-10922,-21845,21845,
%U 43690,-43691,-87381,87382,174763,-174763,-349526,349525,699051,-699050,-1398101,1398101,2796202,-2796203,-5592405
%N Expansion of (1+x^2)/((1-x+x^2)(1+2x^2)).
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,-3,2,-2).
%F G.f.: (1+x^2)^2/((1+x^2)^3+x^6)+x(1+x^2)/((1+x^2)^3+x^6); a(n)=sum{k=0..floor(n/2), T(n-k, k)(-1)^k}, T(n, k)=sum{i=0..n, C(n, i)} (A008949); a(n)=(-1)^(n/2)sum{k=0..floor(n/6), C(n/2, 3k)}(1+(-1)^n)2+ (-1)^((n-1)/2)sum{k=0..floor((n+1)/6), C((n+1)/2, 3k+1)}(1-(-1)^n)/2; a(n)=2^(n/2)(cos(pi*n/2)/3+sqrt(2)sin(pi*n/2)/3)+cos(pi*n/3+pi/3)/3+sqrt(3)sin(pi*n/3+pi/3)/3; a(2n)=(-1)^n*A024493(n); a(2n+1)=(-1)^n*A024494(n).
%F a(0)=1, a(1)=1, a(2)=-1, a(3)=-2, a(n)=a(n-1)-3*a(n-2)+2*a(n-3)- 2*a(n-4) [From Harvey P. Dale, Oct 28 2011]
%t CoefficientList[Series[(1+x^2)/((1-x+x^2)(1+2x^2)),{x,0,50}],x] (* or *) LinearRecurrence[{1,-3,2,-2},{1,1,-1,-2},50] (* _Harvey P. Dale_, Oct 28 2011 *)
%Y Cf. A001045, A078008.
%K easy,sign
%O 0,4
%A _Paul Barry_, Jan 13 2005