OFFSET
0,3
REFERENCES
B. Sturmfels, Algorithms in Invariant Theory, Springer, p. 42.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1,1,-1,-1,1).
FORMULA
G.f.: (1 -x +x^2 -x^3)/( (1+x^2)*(1+x)^2*(1-x)^3 ). - R. J. Mathar, Dec 18 2014
a(n) = (5 + 7*(-1)^n + (2-i*2)*(-i)^n + (2+2*i)*i^n + 2*(3+(-1)^n)*n + 2*n^2) / 16 where i = sqrt(-1). - Colin Barker, Oct 15 2015
a(n) = (n/2 + 9/4)*floor(n/2) + floor((n+1)/4) - (n^2 + 7*n)/8 + 1. - Ridouane Oudra, Oct 17 2020
MAPLE
(1+2*x^3+x^4)/((1-x^2)^2*(1-x^4)): seq(coeff(series(%, x, n+1), x, n), n=0..60);
MATHEMATICA
CoefficientList[Series[(1+2x^3+x^4)/((1-x^2)^2(1-x^4)), {x, 0, 60}], x] (* Vincenzo Librandi, Aug 15 2013 *)
LinearRecurrence[{1, 1, -1, 1, -1, -1, 1}, {1, 0, 2, 2, 5, 4, 8}, 60] (* Harvey P. Dale, Aug 20 2017 *)
PROG
(PARI) a(n) = (5 + 7*(-1)^n + (2-I*2)*(-I)^n + (2+2*I)*I^n + 2*(3+(-1)^n)*n + 2*n^2) / 16 \\ Colin Barker, Oct 15 2015
(Magma) R<x>:=PowerSeriesRing(Integers(), 60); Coefficients(R!( (1+2*x^3+x^4)/((1-x^2)^2*(1-x^4)) )); // G. C. Greubel, Sep 12 2019
(Sage)
def A008818_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P((1+2*x^3+x^4)/((1-x^2)^2*(1-x^4))).list()
A008818_list(60) # G. C. Greubel, Sep 12 2019
(GAP) a:=[1, 0, 2, 2, 5, 4, 8];; for n in [8..60] do a[n]:=a[n-1]+a[n-2]-a[n-3]+a[n-4]-a[n-5]-a[n-6]+a[n-7]; od; a; # G. C. Greubel, Sep 12 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved