Combinatorica`
Combinatorica`
NextComposition
NextComposition[l]
constructs the integer composition that follows l in a canonical order.
Details and Options
- To use NextComposition, you first need to load the Combinatorica Package using Needs["Combinatorica`"].