A052527 Expansion of (1-x)/(1-x-x^2-x^3+x^4).
1, 0, 1, 2, 2, 5, 8, 13, 24, 40, 69, 120, 205, 354, 610, 1049, 1808, 3113, 5360, 9232, 15897, 27376, 47145, 81186, 139810, 240765, 414616, 714005, 1229576, 2117432, 3646397, 6279400, 10813653, 18622018, 32068674, 55224945, 95101984
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 453
- Index entries for linear recurrences with constant coefficients, signature (1,1,1,-1).
Programs
-
GAP
a:=[1,0,1,2];; for n in [5..40] do a[n]:=a[n-1]+a[n-2]+a[n-3] -a[n-4]; od; a; # G. C. Greubel, May 13 2019
-
Magma
R
:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x)/(1-x-x^2-x^3+x^4) )); // G. C. Greubel, May 13 2019 -
Maple
spec := [S,{S=Sequence(Prod(Z,Z,Union(Z,Sequence(Z))))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20);
-
Mathematica
LinearRecurrence[{1,1,1,-1}, {1,0,1,2}, 40] (* G. C. Greubel, May 13 2019 *)
-
PARI
my(x='x+O('x^40)); Vec((1-x)/(1-x-x^2-x^3+x^4)) \\ G. C. Greubel, May 13 2019
-
Sage
((1-x)/(1-x-x^2-x^3+x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, May 13 2019
Formula
G.f.: (1-x)/(1 - x - x^2 - x^3 + x^4).
a(n) = a(n+1) +a(n+2) +a(n+3) -a(n+4), a(0)=1, a(1)=0, a(2)=1, a(3)=2.
a(n) = Sum_{alpha = RootOf(1-x-x^2-x^3+x^4)} (1/39)*(2 + 11*alpha - 4*alpha^2 - alpha^3)*alpha^(-1-n).
Extensions
More terms from James Sellers, Jun 05 2000
Comments