# Find three numbers given their sum, product and sum of their squares

Given three unknown positive integers. Is it possible to find the three numbers if we are given their Sum->(a+b+c) = X Product-> (abc) = Y Sum of Squares-> (a^2 + b^2 + c^2) = Z

Here is a method you can try. Let

$s_1=a+b+c$,

$s_2=a^2+b^2+c^2$,

$p_2=ab+bc+ac$,

$p_3=abc$

$a, b, c$ are the roots of the cubic $$0=(x-a)(x-b)(x-c)=x^3-s_1x^2+p_2x-p_3$$

We don't know $p_2$ but can calculate it using $s_1^2=s_2+2p_2$, and then solve the cubic to find $a,b,c$.

• Is there an easy method to calculate the roots if coefficients are integers..?? Or any method other than Hit-and-Trial. – user143544 Apr 17 '14 at 14:15
• @user143544 You need to find three different numbers, and one of the conditions you have fixes the third degree expression $abc$. So you almost inevitably have to solve a cubic (special cases excepted). Integer solutions are constrained (if coefficients are integers they must be factors of $p_3$). There are formulae and methods for solving the general cubic - e.g. Cardano method mathsa.ucd.ie/courses/mst3022/history4.pdf – Mark Bennet Apr 17 '14 at 14:30

Yes. Try squaring $X=(a+b+c)$.

• when is the product used ? – T_O Apr 16 '14 at 11:25
• but then how to get 2(ab+bc+ca)..?? – user143544 Apr 16 '14 at 11:26
• It appears that I made a mistake whilst calculating as usual. Mark's method is best I can think of right now – Jack Yoon Apr 16 '14 at 11:36