A383351 Triangle read by rows: T(n, k) is the number of partitions of a 2-colored set of n objects into k parts where 0 <= k <= n, and each part is one of 2 kinds.
1, 0, 4, 0, 6, 10, 0, 8, 24, 20, 0, 10, 53, 60, 35, 0, 12, 88, 164, 120, 56, 0, 14, 144, 348, 370, 210, 84, 0, 16, 208, 672, 904, 700, 336, 120, 0, 18, 299, 1174, 1998, 1870, 1183, 504, 165, 0, 20, 400, 1952, 3952, 4524, 3360, 1848, 720, 220
Offset: 0
Examples
Triangle starts: 0 : [1] 1 : [0, 4] 2 : [0, 6, 10] 3 : [0, 8, 24, 20] 4 : [0, 10, 53, 60, 35] 5 : [0, 12, 88, 164, 120, 56] 6 : [0, 14, 144, 348, 370, 210, 84] 7 : [0, 16, 208, 672, 904, 700, 336, 120] 8 : [0, 18, 299, 1174, 1998, 1870, 1183, 504, 165] 9 : [0, 20, 400, 1952, 3952, 4524, 3360, 1848, 720, 220] 10 : [0, 22, 534, 3052, 7394, 9834, 8652, 5488, 2724, 990, 286] ...
Crossrefs
Programs
-
Python
from sympy import binomial from sympy.utilities.iterables import partitions def calc_w(k , m): s = 0 for p in partitions(m, m=k+1): fact = 1 j = k + 1 for x in p : fact *= binomial(j, p[x]) * (x + 1) ** p[x] j -= p[x] s += fact return s def t_row(n): if n == 0 : return [1] t = list([0] * n) for p in partitions( n): fact = 1 s = 0 for k in p : s += p[k] fact *= calc_w(k, p[k]) if s > 0 : t[s - 1] += fact return [0] + t