check for an integer partition - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Type Checking : Types : type/partition

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 k1,k2,..,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


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam