A382041 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.
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, 350, 490, 574, 0, 4, 52, 236, 556, 896, 1120, 1240, 0, 4, 62, 310, 845, 1505, 2079, 2415, 2580, 0, 4, 68, 400, 1200, 2400, 3584, 4480, 4960, 5180, 0, 4, 78, 494, 1670, 3626, 5910, 7842, 9162, 9822, 10108
Offset: 0
Examples
Triangle starts: 0 : [1] 1 : [0, 4] 2 : [0, 4, 14] 3 : [0, 4, 20, 40] 4 : [0, 4, 30, 70, 105] 5 : [0, 4, 36, 116, 196, 252] 6 : [0, 4, 46, 170, 350, 490, 574] 7 : [0, 4, 52, 236, 556, 896, 1120, 1240] 8 : [0, 4, 62, 310, 845, 1505, 2079, 2415, 2580] 9 : [0, 4, 68, 400, 1200, 2400, 3584, 4480, 4960, 5180] 10 : [0, 4, 78, 494, 1670, 3626, 5910, 7842, 9162, 9822, 10108] ...
Programs
-
Python
from sympy import binomial from sympy.utilities.iterables import partitions from sympy.combinatorics.partitions import IntegerPartition kinds = 4 - 1 # the number of part kinds - 1 def a382041_row( n): if n == 0 : return [1] t = list( [0] * n) for p in partitions( n): p = IntegerPartition( p).as_dict() fact = 1 s = 0 for k in p : s += p[k] fact *= binomial( kinds + p[k], kinds) if s > 0 : t[s - 1] += fact for i in range( n - 1): t[i+1] += t[i] return [0] + t
Comments