# Solutions of a special system of diophantine equations?

How many nonnegative integer solutions of the following diophantine equations? And how to find them? \begin{equation} \left\{ \begin{aligned} x_1+x_2+\cdots+x_n=r\\ x_1+2x_2+\cdots+nx_n=n\\ \end{aligned} \right. \end{equation} 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$. 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: \begin{equation} \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. \end{equation} where $1\leq r\leq n;r,n\in Z^+.$ 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})$. Oct 23 '19 at 1:49
• Condition on $x_n$, the number of times that part $n$ appears. Oct 23 '19 at 6:28