A052612 Expansion of e.g.f. x*(2+x)/(1-x^2).
0, 2, 2, 12, 24, 240, 720, 10080, 40320, 725760, 3628800, 79833600, 479001600, 12454041600, 87178291200, 2615348736000, 20922789888000, 711374856192000, 6402373705728000, 243290200817664000, 2432902008176640000, 102181884343418880000, 1124000727777607680000
Offset: 0
Links
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 557.
Programs
-
Maple
spec := [S,{S=Prod(Z,Union(Sequence(Z),Sequence(Prod(Z,Z))))},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
-
Mathematica
With[{nn=20},CoefficientList[Series[x (2+x)/(1-x^2),{x,0,nn}],x] Range[ 0,nn]!] (* Harvey P. Dale, Jun 10 2018 *) Join[{0}, Table[1/2 (3 - (-1)^n) n!, {n, 20}]] (* David Trimas, Jul 28 2023 *)
-
PARI
a(n)=if(n<0,0,n!*polcoeff((x^2+2*x)/(1-x^2)+x*O(x^n),n))
-
PARI
a(n)=if(n<1,0,n!*(n%2+1))
-
PARI
a(n)= n! / gcd(n, n * (n + 1) / 2) \\ Andrew S. Plewe, Jan 09 2006
Formula
Recurrence: {a(0)=0, a(1)=2, a(2)=2, (-2-n^2-3*n)*a(n)+a(n+2)=0}.
Sum(1/2*(2+_alpha)*_alpha^(-1-n), _alpha=RootOf(-1+_Z^2))*n!.
E.g.f.: x*(x+2)/(1-x^2).
a(2n+1) = 2*(2n+1)!, a(2n) = (2n)!, if n>0.
a(n) = n! if n is even, 2*n! otherwise. a(n) = n!*A000034(n).
a(n) = n! / gcd(n, T(n)) where T(n) is the n-th triangular number. - Andrew S. Plewe, Jan 09 2006
From Amiram Eldar, Jul 06 2022: (Start)
Sum_{n>=1} 1/a(n) = sinh(1)/2 + cosh(1) - 1.
Sum_{n>=1} (-1)^(n+1)/a(n) = sinh(1)/2 - cosh(1) + 1. (End)
a(0)=0, a(n) = (1/2)*(3 - (-1)^n)*n! if n>0. - David Trimas, Jul 28 2023
a(n) = 2 * A191662(n) for n>=1. - Alois P. Heinz, Sep 05 2023
Extensions
a(20)-a(22) from Alois P. Heinz, Sep 05 2023
Comments