A052649 Expansion of e.g.f. (2+x-x^2)/(1-x)^2.
2, 5, 14, 54, 264, 1560, 10800, 85680, 766080, 7620480, 83462400, 997920000, 12933043200, 180583603200, 2702527027200, 43153254144000, 732297646080000, 13160434839552000, 249692574523392000, 4987449116762112000, 104614786351595520000, 2299092397726924800000
Offset: 0
Links
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 596.
- Index entries for sequences related to factorial base representation.
Programs
-
Maple
spec := [S,{S=Prod(Sequence(Z),Union(Z,Sequence(Z),Sequence(Z)))},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
-
Mathematica
f[n_] := (3 + 2 n) n!; f[0] = 2; Array[f, 19, 0] a[n_] := a[n] = a[n - 1]*n (2 n + 3)/(2 n + 1); a[0] = 2; a[1] = 5; Array[ a, 19, 0] (* Robert G. Wilson v *) With[{nn=20},CoefficientList[Series[(2+x-x^2)/(1-x)^2,{x,0,nn}],x] Range[ 0,nn]!] (* Harvey P. Dale, Nov 09 2017 *)
-
PARI
a(n)=if(n<=1,[2,5][n+1], a(n-1)*(n*(2*n+3))/(2*n+1) ); for(n=0,11,print1(a(n),", "))
-
Scheme
(define (A052649 n) (if (zero? n) 2 (+ (A000142 n) (* 2 (A000142 (+ 1 n)))))) ;; Antti Karttunen, Sep 24 2016
Formula
a(n) = (3+2*n)*n!.
E.g.f.: -(-x+x^2-2)/(-1+x)^2.
Recurrence: a(0)=2, a(1)=5, (-7*n-5-2*n^2)*a(n)+(3+2*n)*a(n+1)=0 for n>=1.
a(n) = A129326(n), n>1. - R. J. Mathar, Jun 14 2008
a(n) = (n+1)*a(n-1) - 2*A001048(n-1). - Gary Detlefs, Dec 16 2009
a(0) = 2; for n >= 1, a(n) = 2*(n+1)! + n! - Antti Karttunen, Sep 24 2016
From Amiram Eldar, Feb 17 2024: (Start)
Sum_{n>=0} 1/a(n) = 1/6 + e/2 - erfi(1)*sqrt(Pi)/4, where erfi is the imaginary error function.
Sum_{n>=0} (-1)^n/a(n) = 1/6 - 1/(2*e) + erf(1)*sqrt(Pi)/4, where erf is the error function. (End)
Comments