A102517 Expansion of (1+x^2)/((1-x+x^2)*(1+2*x^2)).
1, 1, -1, -2, 1, 3, -2, -5, 5, 10, -11, -21, 22, 43, -43, -86, 85, 171, -170, -341, 341, 682, -683, -1365, 1366, 2731, -2731, -5462, 5461, 10923, -10922, -21845, 21845, 43690, -43691, -87381, 87382, 174763, -174763, -349526, 349525, 699051, -699050, -1398101, 1398101, 2796202, -2796203, -5592405
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,-3,2,-2).
Programs
-
Mathematica
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 *)
Formula
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..k} C(n, i) (A008949).
a(n) = (-1)^(n/2)*(Sum_{k=0..floor(n/6)} C(n/2, 3*k))*(1+(-1)^n)/2 + (-1)^((n-1)/2)*(Sum_{k=0..floor((n+1)/6)} C((n+1)/2, 3*k+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(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). - Harvey P. Dale, Oct 28 2011