next
|
previous
|
forward
|
backward
| up |
top
|
index
|
toc
|
home
compositions -- compositions of an integer
Synopsis
Usage:
compositions(k,n)
Inputs:
k
,
an
integer
, a nonnegative integer
n
,
an
integer
, also nonnegative
Outputs:
a
list
, of all of the ways of writing
n
as a sum of exactly
k
nonnegative integers
Description
i1 : compositions(2,5) o1 = {{5, 0}, {4, 1}, {3, 2}, {2, 3}, {1, 4}, {0, 5}} o1 : List
See also
partitions
-- list the partitions of an integer
combinatorial functions
Ways to use
compositions
:
compositions(ZZ,ZZ)