# Solutions of a special system of diophantine equations?

How many nonnegative integer solutions of the following diophantine equations? And how to find them? \left\{ \begin{aligned} x_1+x_2+\cdots+x_n=r\\ x_1+2x_2+\cdots+nx_n=n\\ \end{aligned} \right. where $$1\leq r\leq n;r,n\in Z^+.$$

I will appreciate it for any advices and suggestions! Thank you very much!

• @Matt Solutions are only required to be non-negative, so I don't see even why the LHS of the first equation has to be at least $n$. – provocateur Oct 21 '19 at 12:31

The solutions correspond to partitions of $$n$$ into $$r$$ parts, and $$x_i$$ is the number of times that part $$i$$ is used. A recurrence is given here, and you can use a similar recursion to enumerate them.
• @Pratt Thanks a lot. Actually, it is equivalent to the following equations: \left\{ \begin{aligned} x_1+x_2+\cdots+x_{n-r+1}=r\\ x_1+2x_2+\cdots+(n-r+1)x_{n-r+1}=n\\ \end{aligned} \right. where $1\leq r\leq n;r,n\in Z^+.$ – Jacob.Z.Lee Oct 23 '19 at 1:41
• There are some relations between patial Bell Polynomial and this problems. The number of solutions is the number of monomials in Bell polynomial $B_{n,r}(x_1,x_2,\cdots, x_{n-r+1})$. – Jacob.Z.Lee Oct 23 '19 at 1:49
• Condition on $x_n$, the number of times that part $n$ appears. – RobPratt Oct 23 '19 at 6:28