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

Parameters

Description

Examples

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 [ k1,...,kr]. of positive integers ki, whose sum is equal to n, and which is non-decreasing, that is, which satisfies addki,i=1..r=n and kiki+1, for i in 1..r1.

Examples

type1,2,3,4,partition

false

(1)

type1,2,23,partition

false

(2)

type1,2,3,partition

false

(3)

type1,2,3,partition

true

(4)

type1,2,3,3,4,partition

true

(5)

type1,2,3,3,2,partition

false

(6)

See Also

combinat/partition

type/permlist