%I #12 Mar 19 2025 10:39:55
%S 1,0,4,0,4,14,0,4,20,40,0,4,30,70,105,0,4,36,116,196,252,0,4,46,170,
%T 350,490,574,0,4,52,236,556,896,1120,1240,0,4,62,310,845,1505,2079,
%U 2415,2580,0,4,68,400,1200,2400,3584,4480,4960,5180,0,4,78,494,1670,3626,5910,7842,9162,9822,10108
%N Triangle read by rows: T(n, k) is the number of partitions of n with at most k parts where 0 <= k <= n, and each part is one of four kinds.
%C Two unrestricted unary predicates on the parts set result in four kinds: The intersection, the both differences and the complement of the union.
%C The 1-kind case is Euler's table A026820.
%C The 2-kind case is A381895.
%C The 3-kind case is A382025.
%e Triangle starts:
%e 0 : [1]
%e 1 : [0, 4]
%e 2 : [0, 4, 14]
%e 3 : [0, 4, 20, 40]
%e 4 : [0, 4, 30, 70, 105]
%e 5 : [0, 4, 36, 116, 196, 252]
%e 6 : [0, 4, 46, 170, 350, 490, 574]
%e 7 : [0, 4, 52, 236, 556, 896, 1120, 1240]
%e 8 : [0, 4, 62, 310, 845, 1505, 2079, 2415, 2580]
%e 9 : [0, 4, 68, 400, 1200, 2400, 3584, 4480, 4960, 5180]
%e 10 : [0, 4, 78, 494, 1670, 3626, 5910, 7842, 9162, 9822, 10108]
%e ...
%o (Python)
%o from sympy import binomial
%o from sympy.utilities.iterables import partitions
%o from sympy.combinatorics.partitions import IntegerPartition
%o kinds = 4 - 1 # the number of part kinds - 1
%o def a382041_row( n):
%o if n == 0 : return [1]
%o t = list( [0] * n)
%o for p in partitions( n):
%o p = IntegerPartition( p).as_dict()
%o fact = 1
%o s = 0
%o for k in p :
%o s += p[k]
%o fact *= binomial( kinds + p[k], kinds)
%o if s > 0 :
%o t[s - 1] += fact
%o for i in range( n - 1):
%o t[i+1] += t[i]
%o return [0] + t
%Y Main diagonal gives A023003.
%Y Cf. A026820, A381895, A382025.
%K nonn,tabl
%O 0,3
%A _Peter Dolland_, Mar 12 2025