A052907 Expansion of 1/(1 - 2*x^2 - 2*x^3).
1, 0, 2, 2, 4, 8, 12, 24, 40, 72, 128, 224, 400, 704, 1248, 2208, 3904, 6912, 12224, 21632, 38272, 67712, 119808, 211968, 375040, 663552, 1174016, 2077184, 3675136, 6502400, 11504640, 20355072, 36014080, 63719424, 112738304, 199467008
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 887
- Index entries for linear recurrences with constant coefficients, signature (0,2,2).
Programs
-
GAP
a:=[1,0,2];; for n in [4..40] do a[n]:=2*(a[n-2]+a[n-3]); od; a; # G. C. Greubel, Oct 14 2019
-
Magma
I:=[1,0,2]; [n le 3 select I[n] else 2*Self(n-2)+2*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 14 2015
-
Magma
R
:=PowerSeriesRing(Integers(), 36); Coefficients(R!( 1/(1 - 2*x^2 - 2*x^3))); // Marius A. Burtea, Oct 15 2019 -
Maple
spec := [S,{S=Sequence(Prod(Union(Z,Z),Union(Z,Prod(Z,Z))))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20);
-
Mathematica
LinearRecurrence[{0,2,2},{1,0,2},40] (* Harvey P. Dale, Oct 30 2011 *) CoefficientList[Series[1/(1-2x^2-2x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Feb 14 2015 *)
-
PARI
my(x='x+O('x^40)); Vec(1/(1-2*x^2-2*x^3)) \\ G. C. Greubel, Oct 14 2019
-
Sage
def A052907_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P( 1/(1-2*x^2-2*x^3) ).list() A052907_list(40) # G. C. Greubel, Oct 14 2019
Formula
G.f.: 1/(1 - 2*x^2 - 2*x^3).
a(n) = 2*a(n-2) + 2*a(n-3), with a(0)=1, a(1)=0, a(2)=2.
a(n) = Sum_{alpha = RootOf(-1 + 2*z^2 + 2*z^3)} (-1/19)*(-3 - 5*alpha + 4*alpha^2)*alpha^(-1 - n).
a(n) = Sum_{k=0..floor(n/2)} binomial(k, n-2*k)*2^k. - Paul Barry, Oct 19 2004
Construct the matrix T with elements T(n,j) = [A^*j]*[S^*(j-1)](n) with the sequences A = (0,2,2,0,0...) and S = (0,1,0,0...) and the convolution operation *. Define S^*0 = I = (1, repeat(0)). Then T(n,j) for j>=1, counts closed n-walks containing j loops on the graph defined above in a comment, and a(n) = Sum_{j=1..n} T(n,j). - David Neil McGrath, Jan 16 2015
Extensions
More terms from James Sellers, Jun 05 2000
Comments