A333059 Number of entries in the second blocks of all set partitions of [n] when blocks are ordered by decreasing lengths.
1, 4, 17, 76, 357, 1737, 8997, 49420, 289253, 1793221, 11727861, 80576965, 579781009, 4356513727, 34118896917, 277963716808, 2351740613433, 20630800971825, 187374815249205, 1759353644746663, 17055176943817785, 170477858336708555, 1754992340756441973
Offset: 2
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 2..576
- Wikipedia, Partition of a set
Crossrefs
Column k=2 of A319375.
Programs
-
Maple
b:= proc(n, i, t) option remember; `if`(n=0, [1, 0], `if`(i<1, 0, add((p-> p+`if`(t>0 and t-j<1, [0, p[1]*i], 0))( combinat[multinomial](n, i$j, n-i*j)/j!* b(n-i*j, min(n-i*j, i-1), max(0, t-j))), j=0..n/i))) end: a:= n-> b(n$2, 2)[2]: seq(a(n), n=2..24);
-
Mathematica
multinomial[n_, k_List] := n!/Times @@ (k!); b[n_, i_, t_] := b[n, i, t] = If[n == 0, {1, 0}, If[i < 1, {0, 0}, Sum[Function[p, p + If[t > 0 && t - j < 1, {0, p[[1]]*i}, {0, 0}]][ multinomial[n, Append[Table[i, {j}], n - i*j]]/j!* b[n - i*j, Min[n - i*j, i - 1], Max[0, t - j]]], {j, 0, n/i}]]]; a[n_] := b[n, n, 2][[2]]; a /@ Range[2, 24] (* Jean-François Alcover, Apr 24 2021, after Alois P. Heinz *)