OFFSET
0,3
COMMENTS
a(n) counts ordered walks of weight n on a single vertex graph containing 4 distinctly labeled loops of weights 2, 2, 3 and 3. - David Neil McGrath, Jan 16 2015
Number of compositions (ordered partitions) of n into parts 2 and 3, each of two sorts. - Joerg Arndt, Feb 14 2015
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).
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
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 *)
PROG
(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
(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.<x> = PowerSeriesRing(ZZ, prec)
return P( 1/(1-2*x^2-2*x^3) ).list()
A052907_list(40) # G. C. Greubel, Oct 14 2019
(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) R<x>:=PowerSeriesRing(Integers(), 36); Coefficients(R!( 1/(1 - 2*x^2 - 2*x^3))); // Marius A. Burtea, Oct 15 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
EXTENSIONS
More terms from James A. Sellers, Jun 05 2000
STATUS
approved