icomp accepts two or three arguments : a positive integer n, a positive integer k not larger than n and optionally zeros=true or zeros=false. The return value is the list of all compostions of n into k parts. Each composition is a list of nonnegative integers which sum up to n. If the option zeros is set to true (which is the default), a part can have zero value. Else, each part has nonzero (positive) value.
For example, input :
Output :
Input :
Output :