**Example 1**. Find all pairs of non-negative integers *x* and *y* such that *y*^{2}(*x* + 1) = 1576 + *x*^{2}.

**Example 2**. Sixteen numbers are put into the boxes of a four-by-four array, so as to form a magic square. This means that the four row sums, the four column sums and the two diagonal sums are each equal to the same number *s*. Show that *s* is also the sum of the four numbers in the corners of the array (do not assume that the sixteen numbers are the integers 1, 2, 3, . . . , 16).

**Solution 1**. Let *x* and *y* are non-negative integers such that *y*^{2}(*x* + 1) = 1576 + *x*^{2}. Then

y^{2}(x+ 1) = 1576 +x^{2}or,

y^{2}(x+ 1) = 1577 + (x^{2}– 1)or,

y^{2}(x+ 1) = 1577 + (x– 1) (x+ 1)or,

y^{2}(x+ 1) – (x– 1) (x+ 1) = 1577or, (

x+ 1) (y^{2}–x+ 1) = 19 × 83.

In particular, (*x* + 1) is a positive divisor of 19 × 83 with quotient (*y*^{2} – *x* + 1).

- If
*x*+ 1 = 1, then*x*= 0 and*y*^{2}–*x*+ 1 = 1577 so that*y*^{2}= 1576. - If
*x*+ 1 = 19, then*x*= 18 and*y*^{2}–*x*+ 1 = 83 so that*y*^{2}= 83 + 17 = 100. - If
*x*+ 1 = 83, then*x*= 82 and*y*^{2}–*x*+ 1 = 19 so that*y*^{2}= 100. - If
*x*+ 1 = 1577, then*x*= 1576 and*y*^{2}–*x*+ 1 = 1 so that*y*^{2}= 1576.

Since √1576 ≈ 39.7 is not an integer, the two possibilities are (*x*, *y*) = (18, 10) and (82, 10).

**Solution 2**. First observe that the sum of all 16 numbers is the sum of the four rows, which is 4*s*.

The sum of the middle two rows, the middle two columns and the two diagonals is 6*s* and this uses all of the numbers once except for the middle four, each of which is used three times.

If we write *m* to denote the sum of the middle four numbers, we see that 6*s* is the sum of all the numbers plus an extra 2*m*.

This gives the equation 6*s* = 4*s* + 2*m*, from which we deduce that *m* = *s*.

Finally note that the sum of the two diagonals is 2*s*, and this is the sum of the four middle boxes plus the sum of the four corners. Since the middle boxes sum to *m* = *s*, it follows that the corner boxes also sum to *s*, as wanted.