OFFSET
0,4
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 482
Index entries for linear recurrences with constant coefficients, signature (1,1,2,-2).
FORMULA
G.f.: (1-x)/(1-x-2*x^3+2*x^4-x^2).
a(n) = a(n-1) + a(n-2) + 2*a(n-3) - 2*a(n-4), with a(0)=1, a(1)=0, a(2)=1, a(3)=3.
a(n) = Sum_{alpha = RootOf(1-x-2*x^3+2*x^4-x^2)} (-1/353 * (-18-106*alpha+33*alpha^2+28*alpha^3) * alpha^(-1-n)).
MAPLE
spec := [S, {S=Sequence(Prod(Z, Z, Union(Z, Z, Sequence(Z))))}, unlabeled]: seq(combstruct[count](spec, size=n), n=0..40);
MATHEMATICA
CoefficientList[Series[(1-x)/(1-x-x^2-2x^3+2x^4), {x, 0, 40}], x] (* or *) LinearRecurrence[{1, 1, 2, -2}, {1, 0, 1, 3}, 40] (* Harvey P. Dale, Jul 02 2017 *)
PROG
(PARI) my(x='x+O('x^40)); Vec((1-x)/(1-x-2*x^3+2*x^4-x^2)) \\ G. C. Greubel, May 08 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x)/(1-x-2*x^3+2*x^4-x^2) )); // G. C. Greubel, May 08 2019
(Sage) ((1-x)/(1-x-2*x^3+2*x^4-x^2)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, May 08 2019
(GAP) a:=[1, 0, 1, 3];; for n in [5..40] do a[n]:=a[n-1]+a[n-2]+2*a[n-3] -2*a[n-4]; od; a; # G. C. Greubel, May 08 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
EXTENSIONS
More terms from James A. Sellers, Jun 06 2000
STATUS
approved