Originally Posted by
YesNo
I suppose we could shorten the brute force result with some algebra. Let the two unknown numbers be X and Y. We are given the sum of those numbers, X + Y, and the sum of the squares, X2 + Y2. As an example we can say the sum of the numbers is 6 and the sum of their squares is 26. We can change these parameters later. What are the numbers X and Y?
Since X + Y = 6, we know X = 6 - Y.
We can do the following transformation X2 + Y2 = (6 - Y)2 + Y2 = 36 - 12Y + Y2 + Y2 = 36 - 12Y + 2Y2.
We are given that 36 - 12Y + 2Y2 = 26, so we can subtract both sides of the equation by 26 and get the following quadratic equation: 10 - 12Y + 2Y2 = 2(Y - 1)(Y - 5) = 0. There will be two solutions to this equation. If they are integers then we have the solutions we want. We can see that Y could be either 1 or 5. X would be the opposite.