numbcomp - Maple Help

combinat

 numbcomp
 the number of k-compositions of an integer

 Calling Sequence numbcomp(n, k)

Parameters

 n, k - any integers

Description

 • The numbcomp command counts the number of distinct ordered k-tuples of positive integers whose elements sum to n. For information on the composition command, which constructs k-compositions, see the combinat[composition] help page.
 • Note that $\mathrm{numbcomp}\left(n,k\right)=\mathrm{nops}\left(\mathrm{composition}\left(n,k\right)\right)=\mathrm{binomial}\left(n-1,k-1\right)$ for $n,k>0$ .

Examples

 > $\mathrm{with}\left(\mathrm{combinat},\mathrm{numbcomp}\right)$
 $\left[{\mathrm{numbcomp}}\right]$ (1)
 > $\mathrm{numbcomp}\left(7,3\right)$
 ${15}$ (2)
 > $\mathrm{numbcomp}\left(5,4\right)$
 ${4}$ (3)