partition - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

type/partition

check for an integer partition

 Calling Sequence type( expr, 'partition' )

Parameters

 expr - anything; any Maple expression

Description

 • The call type( expr, 'partition' ) returns true if expr is a partition of a positive integer, and returns false otherwise.
 • A partition of a positive integer $n$ is a list [ ${k}_{1},\mathrm{...},{k}_{r}$]. of positive integers ${k}_{i}$, whose sum is equal to $n$, and which is non-decreasing, that is, which satisfies $\mathrm{add}\left({k}_{i},i=1..r\right)=n$ and ${k}_{i}\le {k}_{i+1}$, for $i$ in $1..r-1$.

Examples

 > $\mathrm{type}\left(\left\{\left\{1,2\right\},\left\{3,4\right\}\right\},'\mathrm{partition}'\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(\left[1,2,\frac{2}{3}\right],'\mathrm{partition}'\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{type}\left(\left[1,-2,3\right],'\mathrm{partition}'\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{type}\left(\left[1,2,3\right],'\mathrm{partition}'\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{type}\left(\left[1,2,3,3,4\right],'\mathrm{partition}'\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{type}\left(\left[1,2,3,3,2\right],'\mathrm{partition}'\right)$
 ${\mathrm{false}}$ (6)

 See Also