combinat
encodepart
compute canonical integer representing partition
decodepart
compute canonical partition represented by integer
Calling Sequence
Parameters
Description
Examples
encodepart(l)
decodepart(n, m)
l
-
partition; non-decreasing list of positive integers
n
positive integer
m
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.
with⁡combinat:
partition⁡3
1,1,1,1,2,3
decodepart⁡3,1
1,1,1
decodepart⁡3,2
1,2
decodepart⁡3,3
3
encodepart⁡1,2
2
See Also
combinat[inttovec]
combinat[nextpart]
combinat[numbpart]
combinat[partition]
combinat[prevpart]
combinat[vectoint]
Download Help Document