Let be a positive integer. Into every square of an array we inscribe an integer so that the sum of the integers inside any square is negative. Find all positive integers for which this can be done in such a way that the sum of all the numbers in the array is positive.
Solution
When is divisible by , . The array can be divided into squares. The sum of the numbers inside each square is negative, so the sum of all these sums, which is the sum of all the numbers in the array, is negative as well.
If is not divisible by , the numbers can be inscribed as required. To make things easier let us assume that all positive numbers in the array are equal and all negative numbers in the array are equal.
The cases and are represented in the top two figures. Each square contains eight ones and one , so the sum is , while the sum of all the numbers in the array is and , respectively.
<table>
<tr><td>1</td><td>1</td><td>1</td><td>1</td></tr>
<tr><td>1</td><td>1</td><td>-9</td><td>1</td></tr>
<tr><td>1</td><td>1</td><td>1</td><td>1</td></tr>
<tr><td>1</td><td>1</td><td>1</td><td>1</td></tr>
</table>
<table>
<tr><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr>
<tr><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr>
<tr><td>1</td><td>1</td><td>-9</td><td>1</td><td>1</td></tr>
<tr><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr>
<tr><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr>
</table>
Now, let us choose an arbitrary and consider the array and the array. Cover the array in the upper left corner with squares as shown. For each of these squares put into the lower right corner and into the other eight squares as well as into all the remaining squares in the array.
<table>
<tr><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td></tr>
<tr><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td></tr>
<tr><td>a</td><td>a</td><td>-b</td><td>a</td><td>a</td><td>-b</td><td>a</td><td>a</td><td>-b</td><td>a</td></tr>
<tr><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td></tr>
<tr><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td></tr>
<tr><td>a</td><td>a</td><td>-b</td><td>a</td><td>a</td><td>-b</td><td>a</td><td>a</td><td>-b</td><td>a</td></tr>
<tr><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td></tr>
<tr><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td></tr>
<tr><td>a</td><td>a</td><td>-b</td><td>a</td><td>a</td><td>-b</td><td>a</td><td>a</td><td>-b</td><td>a</td></tr>
<tr><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td><td>a</td></tr>
</table>
The sum inside each square is and the sum of all numbers in the array is or . Since , we can write , where is a positive integer. Then implies
If we set and , we get .
Hence, for or arrays we can arrange the numbers and as described above. Then the sum of the numbers inside each square is equal to , while the sum of all the numbers in the array is or , and thus positive.