Combinatorica`
Combinatorica`

NextComposition

NextComposition[l]

constructs the integer composition that follows l in a canonical order.

Details