A322765 Array read by upwards antidiagonals: T(m,n) = number of set partitions of the multiset consisting of one copy each of x_1, x_2, ..., x_m, and two copies each of y_1, y_2, ..., y_n, for m >= 0, n >= 0.
1, 1, 2, 2, 4, 9, 5, 11, 26, 66, 15, 36, 92, 249, 712, 52, 135, 371, 1075, 3274, 10457, 203, 566, 1663, 5133, 16601, 56135, 198091, 877, 2610, 8155, 26683, 91226, 325269, 1207433, 4659138, 4140, 13082, 43263, 149410, 537813, 2014321, 7837862, 31638625, 132315780
Offset: 0
Examples
The array begins: 1, 2, 9, 66, 712, 10457, 198091, ... 1, 4, 26, 249, 3274, 56135, 1207433, ... 2, 11, 92, 1075, 16601, 325269, 7837862, ... 5, 36, 371, 5133, 91226, 2014321, 53840640, ... 15, 135, 1663, 26683, 537813, 13241402, 389498179, ... 52, 566, 8155, 149410, 3376696, 91914202, 2955909119, ... 203, 2610, 43263, 894124, 22451030, 670867539, 23456071495, ... ...
References
- D. E. Knuth, The Art of Computer Programming, Vol. 4A, Table A-1, page 778.
Links
- Seiichi Manyama, Antidiagonals n = 0..139, flattened
Crossrefs
Programs
-
Maple
B := n -> combinat[bell](n): P := proc(m,n) local k; global B; option remember; if n = 0 then B(m) else (1/2)*( P(m+2,n-1) + P(m+1,n-1) + add( binomial(n-1,k)*P(m,k), k=0..n-1) ); fi; end; # P(m,n) (which is Knuth's notation) is T(m,n)
-
Mathematica
P[m_, n_] := P[m, n] = If[n == 0, BellB[m], (1/2)(P[m+2, n-1] + P[m+1, n-1] + Sum[Binomial[n-1, k] P[m, k], {k, 0, n-1}])]; Table[P[m-n, n], {m, 0, 8}, {n, 0, m}] // Flatten (* Jean-François Alcover, Jan 02 2019, from Maple *)
-
PARI
{T(n, k) = if(k==0, sum(j=0, n, stirling(n, j, 2)), (T(n+2, k-1)+T(n+1, k-1)+sum(j=0, k-1, binomial(k-1, j)*T(n, j)))/2)} \\ Seiichi Manyama, Nov 21 2020