A117666 Expansion of (1-3*x+x^2)*(1-x-x^2)/((1+x+x^2)*(1-x+x^2)*(1-x)^2).
1, -2, -3, 2, 3, 2, 3, 0, -1, 4, 5, 4, 5, 2, 1, 6, 7, 6, 7, 4, 3, 8, 9, 8, 9, 6, 5, 10, 11, 10, 11, 8, 7, 12, 13, 12, 13, 10, 9, 14, 15, 14, 15, 12, 11, 16, 17, 16, 17, 14, 13, 18, 19, 18, 19, 16, 15, 20, 21, 20, 21, 18, 17, 22, 23, 22, 23, 20, 19, 24, 25, 24, 25, 22, 21, 26, 27, 26, 27, 24, 23, 28, 29, 28, 29, 26, 25
Offset: 0
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-2,2,-1).
Programs
-
GAP
a:=[1,-2,-3,2,3,2];; for n in [7..100] do a[n]:=2*a[n-1] -2*a[n-2] +2*a[n-3] -2*a[n-4] +2*a[n-5] -a[n-6]; od; a; # G. C. Greubel, Jul 13 2019
-
Magma
R
:=PowerSeriesRing(Integers(), 100); Coefficients(R!( (1-3*x+x^2)*(1-x-x^2)/((1+x^2+x^4)*(1-x)^2) )); // G. C. Greubel, Jul 13 2019 -
Mathematica
CoefficientList[Series[(1-3*x+x^2)*(1-x-x^2)/((1+x^2+x^4)*(1-x)^2), {x, 0, 100}], x] (* G. C. Greubel, Jul 13 2019 *)
-
PARI
Vec((1-3*x+x^2)*(1-x-x^2)/((1-x)^2*(1+x^2+x^4)) + O(x^100)) \\ Colin Barker, May 18 2019
-
Sage
((1-3*x+x^2)*(1-x-x^2)/((1+x^2+x^4)*(1-x)^2)).series(x, 100).coefficients(x, sparse=False) # G. C. Greubel, Jul 13 2019
Formula
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - 2*a(n-4) + 2*a(n-5) - a(n-6) for n>5. - Colin Barker, May 18 2019