Fix $k \ge 3$, $n \ge 2k$. Consider the following system of equations: \begin{align} \sum_{i=1}^{n} x_i^2 = 4k-6, \\ \sum_{i=1}^{n} x_i = 2k. \end{align} It seems that the only non-negative integer solutions of the system of equations are (up to permutations of indices): \begin{align} x_1 = \ldots = x_{k-3} =2, x_{k-2}=x_{k-1}=x_k=x_{k+1}=x_{k+2}=x_{k+3}=1, x_{k+1} = \ldots = x_{n} =0. \end{align} Are these all the non-negative integer solutions? What are all the non-negative integer solutions of the system of equations? Thank you very much.
Edit: thanks for the answers. Sorry I realized that I need to add the condition $x_i \le 2$, $i \in \{1,2,\ldots,n\}$. Maybe after we add this condition, the non-negative integer solution is unique.