$$x_1+x_2+x_3+x_4=4$$ $$x_1^2+x_2^2+x_3^2+x_4^2=6$$ $$x_1^3+x_2^3+x_3^3+x_4^3=10$$ $$x_1^4+x_2^4+x_3^4+x_4^4=18$$ How do I find the numbers (which are non-negative integers)?
I am trying to find a general solution, where the sums of powers of the numbers up to the $n$th power are given and there are $n$ variables.
The Newton identities give a way to express the elementary symmetric polynomials in terms of power sums. For example, in your case:
$$e_1 = x_1 + x_2 + x_3 + x_4 = p_1 = 4;$$ $$e_2 = x_1 x_2 + x_1 x_3 + x_1 x_4 + x_2 x_3 + x_2 x_4 + x_3 x_4 = \frac{e_1 p_1 - p_2}{2} = \frac{4^2 - 6}{2} = 5;$$ $$e_3 = x_1 x_2 x_3 + x_1 x_2 x_4 + x_1 x_3 x_4 + x_2 x_3 x_4 = \frac{e_2 p_1 - e_1 p_2 + p_3}{3} = \frac{5 \cdot 4 - 4 \cdot 6 + 10}{3} = 2;$$ $$e_4 = x_1 x_2 x_3 x_4 = \frac{e_3 p_1 - e_2 p_2 + e_1 p_3 - p_4}{4} = \frac{2 \cdot 4 - 5 \cdot 6 + 4 \cdot 10 - 18}{4} = 0,$$ so $x_1,x_2,x_3,x_4$ are the roots of $$X^4 - 4X^3 + 5X^2 - 2X = X(X-1)^2 (X-2);$$ so they are $0,1,1,2$ (or some permutation of these).