A361474 a(n) = 1*binomial(n,2) + 3*binomial(n,3) + 6*binomial(n,4) + 10*binomial(n,5).
0, 0, 1, 6, 24, 80, 225, 546, 1176, 2304, 4185, 7150, 11616, 18096, 27209, 39690, 56400, 78336, 106641, 142614, 187720, 243600, 312081, 395186, 495144, 614400, 755625, 921726, 1115856, 1341424, 1602105, 1901850, 2244896, 2635776, 3079329, 3580710, 4145400, 4779216, 5488321, 6279234
Offset: 0
Examples
The 546 set partitions for n=7 are the following (where the 2 elements selected from the second set are in parentheses): { }, {(1),(2),3,4,5,6,7} (21 of these); {1}, {(2),(3),4,5,6,7} (105 of these); {1,2}, {(3),(4),5,6,7} (210 of these); {1,2,3}, {(4),(5),6,7} (210 of these).
Links
- Index entries for linear recurrences with constant coefficients, signature (6,-15,20,-15,6,-1).
Programs
-
Mathematica
a[n_] := Total[Binomial[n, Range[2, 5]]*{1, 3, 6, 10}]; Array[a, 40, 0] (* Amiram Eldar, Mar 28 2023 *)
-
PARI
a(n) = binomial(n,2) + 3*binomial(n,3) + 6*binomial(n,4) + 10*binomial(n,5); \\ Michel Marcus, Mar 16 2023
-
Python
def A361474(n): return n*(n*(n*(n*(n - 7) + 23) - 29) + 12)//12 # Chai Wah Wu, Apr 16 2023
Formula
E.g.f.: (1 + x + x^2/2 + x^3/6)*x^2/2*exp(x).
O.g.f.: x^2*(1 + 3*x^2 + 6*x^3)/(1 - x)^6. - Stefano Spezia, Mar 16 2023
Comments