diagrams(ZZ,ZZ,ZZ) -- Partitions contained in a rectangle

Synopsis

• Function: diagrams
• Usage:
diagrams(k,n,d)
• Inputs:
• k, an integer, maximum size of each entry in partitions
• n, an integer, number of entries in paritition
• d, an integer, number being partitioned
• Outputs:
• a list of lists of integers $\{a_1, \dots, a_n\}$ such that $k \geq a_1 \geq ... \geq a_n \geq 0$ and $\sum_{i=1}^n a_i = d$