A176732 a(n) = (n+5)*a(n-1) + (n-1)*a(n-2), a(-1)=0, a(0)=1.
1, 6, 43, 356, 3333, 34754, 398959, 4996032, 67741129, 988344062, 15434831091, 256840738076, 4536075689293, 84731451264186, 1668866557980343, 34563571477305464, 750867999393119889, 17072113130285524982, 405423357986250112699, 10037458628015142154452, 258639509502117306002581
Offset: 0
Examples
Necklaces and 6 cords problem. For n=4 one considers the following weak 2-part compositions of 4: (4,0), (3,1), (2,2), and (0,4), where (1,3) does not appear because there are no necklaces with 1 bead. These compositions contribute respectively !4*1,binomial(4,3)*!3*c6(1), (binomial(4,2)*2)*c6(2), and 1*c6(4) with the subfactorials !n:=A000166(n) (see the necklace comment there) and the c6(n):=A001725(n+5) numbers for the pure 6-cord problem (see the remark on the e.g.f. for the k-cord problem in A000153; here for k=6: 1/(1-x)^6). This adds up as 9 + 4*2*6 + (6*1)*42 + 3024 = 3333 = a(4).
Programs
-
Maple
a := n -> hypergeom([-n,7],[],1)*(-1)^n: seq(simplify(a(n)),n=0..9); # Peter Luschny, Apr 25 2015
-
Mathematica
Rest[RecurrenceTable[{a[0]==1,a[-1]==0,a[n]==(n+5)a[n-1]+(n-1)a[n-2]},a,{n,20}]] (* Harvey P. Dale, Oct 01 2012 *)
Formula
E.g.f. (exp(-x)/(1-x))*(1/(1-x)^6) = exp(-x)/(1-x)^7, equivalent to the recurrence.
a(n) = A086764(n+6,6).
a(n) = A090010(n), n>0. - R. J. Mathar, Jul 22 2010
a(n) = (-1)^n*hypergeom([-n,7],[],1). - Peter Luschny, Apr 25 2015
Comments