# Number of compositions of n into k parts (where 0 and 1 are not allowed as parts) [closed]

I know that there is a formula where even 0 is treated as significant, but is there a formula where 1 and 0 cannot be parts?

Edit:The formula that I was referencing was (Excuse the presentation) $$\frac{(n-1)!}{(k-1)!(n-k)!}$$ This one discards the 0, but what I was looking for one that would discard 1 as well. Also, what I'm looking for is the compositions, not the partitions.

## closed as off-topic by Chris Godsil, Jeremy Rickard, Jan-Christoph Schlage-Puchta, Ben McKay, Francois ZieglerOct 12 '18 at 6:37

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "MathOverflow is for mathematicians to ask each other questions about their research. See Math.StackExchange to ask general questions in mathematics." – Chris Godsil, Jeremy Rickard, Ben McKay
If this question can be reworded to fit the rules in the help center, please edit the question.

• It sounds as though you're asking for the number of partitions of an $n$-element set into $k$ parts where each part has $2$ or more elements. Seems that the answer should be $a_n$ where $\sum_{n \geq 0} a_n \frac{x^n}{n!} = \frac{(e^x - 1 - x)^k}{k!}$, whence it's just a matter of working that out. – Todd Trimble Oct 7 '18 at 1:04
• @bof Typo: you meant “$k$ nonnegative parts”, not $2k$. – Jeremy Rickard Oct 7 '18 at 7:48
• Calculating the number of ways to split $n-2k$ into $k$ non-negative parts can be done by a standard “stars and bars” argument, giving the result obtained below: $\binom{n-k-1}{k-1}$. – Anthony Quas Oct 7 '18 at 8:03
• @JeremyRickard Yes, of course. thanks. – bof Oct 7 '18 at 10:34
• The number of compositions of $n$ into $k$ parts with each part $\ge2$ is the same as the number of compositions of $n-k$ into $k$ positive parts, or the number of compositions of $n-2k$ into $k$ nonnegative parts. – bof Oct 7 '18 at 10:38

Give a compsotion of $$n$$ with $$k$$ summands the weight $$x^n y^k$$. The compositions of $$n$$ into $$k$$ parts with terms $$\geq 2$$ are then obtained as $$Sequ(\mathbb{N}_{\geq 2})$$, see for example 2.2.1. of https://arxiv.org/pdf/1409.2562.pdf. Thus the generating function is $$\frac{1}{1-(x^2y+x^3y+....)}=\frac{1-x}{(1-x)-yx^2}$$.
Now you can get a formula by expanding the function $$\frac{1-x}{(1-x)-yx^2}$$.
$$\frac{1-x}{(1-(x+yx^2)}=(1-x) \sum\limits_{k=0}^{\infty}{(x+yx^2)^k}=(1-x) \sum\limits_{k=0}^{\infty}(x^k \sum\limits_{l=0}^{k} \binom{k}{l} (yx)^l)$$. From this one should be able to order the terms together for the form $$y^s x^t$$ to arrive at the result $$\binom{n-k-1}{k-1}$$ as in the comment.
• $\dots$ which is $\binom{n-k-1}{k-1}$. – T. Amdeberhan Oct 7 '18 at 3:30