combinat - Maple Programming Help

Home : Support : Online Help : Mathematics : Discrete Mathematics : Combinatorics : combinat : combinat/partition

combinat

 partition
 partition an integer

 Calling Sequence partition(n, m)

Parameters

 n - non-negative integer; integer to partition m - (optional) non-negative integer; maximum integer in partitions

Description

 • The procedure partition partitions an integer n into all possible sums without regard to order.  The output is a list of lists of integers where the sum of the elements in each list is n.
 • See the function numbpart, which computes the number of partitions.
 • The command with(combinat,partition) allows the use of the abbreviated form of this command.

Examples

 > $\mathrm{with}\left(\mathrm{combinat},\mathrm{partition}\right)$
 $\left[{\mathrm{partition}}\right]$ (1)
 > $\mathrm{partition}\left(0\right)$
 $\left[\left[{}\right]\right]$ (2)
 > $\mathrm{partition}\left(3\right)$
 $\left[\left[{1}{,}{1}{,}{1}\right]{,}\left[{1}{,}{2}\right]{,}\left[{3}\right]\right]$ (3)
 > $\mathrm{partition}\left(6,3\right)$
 $\left[\left[{1}{,}{1}{,}{1}{,}{1}{,}{1}{,}{1}\right]{,}\left[{1}{,}{1}{,}{1}{,}{1}{,}{2}\right]{,}\left[{1}{,}{1}{,}{2}{,}{2}\right]{,}\left[{2}{,}{2}{,}{2}\right]{,}\left[{1}{,}{1}{,}{1}{,}{3}\right]{,}\left[{1}{,}{2}{,}{3}\right]{,}\left[{3}{,}{3}\right]\right]$ (4)