decodepart - Maple Help

combinat

 encodepart
 compute canonical integer representing partition
 decodepart
 compute canonical partition represented by integer

 Calling Sequence encodepart(l) decodepart(n, m)

Parameters

 l - partition; non-decreasing list of positive integers n - positive integer m - positive integer

Description

 • The functions encodepart and decodepart provide a canonical labeling of all the partitions of n.
 • Given a partition l of n, encodepart(l) computes and returns the integer m between $1$ and numbpart(n) uniquely representing this partition.
 • Given a positive integer n and a positive integer m between $1$ and numbpart(n) the function decodepart(m, n) computes and returns the unique partition l represented by this positive integer.
 • The command with(combinat,encodepart) allows the use of the abbreviated form of this command.

Examples

 > $\mathrm{with}\left(\mathrm{combinat}\right):$
 > $\mathrm{partition}\left(3\right)$
 $\left[\left[{1}{,}{1}{,}{1}\right]{,}\left[{1}{,}{2}\right]{,}\left[{3}\right]\right]$ (1)
 > $\mathrm{decodepart}\left(3,1\right)$
 $\left[{1}{,}{1}{,}{1}\right]$ (2)
 > $\mathrm{decodepart}\left(3,2\right)$
 $\left[{1}{,}{2}\right]$ (3)
 > $\mathrm{decodepart}\left(3,3\right)$
 $\left[{3}\right]$ (4)
 > $\mathrm{encodepart}\left(\left[1,2\right]\right)$
 ${2}$ (5)