A magic square is a square table in which the sum of the numbers in any row or column is constant. For example,

| 1 | 5 | 9 |
| :--- | :--- | :--- |
| 8 | 3 | 4 |
| 6 | 7 | 2 |

is a magic square, which uses the numbers from 1 to 9. As the reader can verify, the sum in any row or column is always equal to 15.

a) The square below is part of a magic square that uses the odd numbers between 1 and 17. Determine which number $X$ should be.

|  | 1 |  |
| :---: | :---: | :---: |
| 5 |  | 13 |
| $X$ |  | 3 |

b) A magic square is said to be hypermagic when the sum in any row, column, or diagonal is constant. Write the numbers from 1 to 9 in the square below so that it becomes hypermagic.

![](https://cdn.mathpix.com/cropped/2024_05_01_cc59d970f26105cc4ca1g-01.jpg?height=294&width=297&top_left_y=2406&top_left_x=979)
Solution

a) The sum of all odd numbers from 1 to 17 is 81. Since there are three columns in the square, and all columns (and rows) have the same sum, the sum in each column must be $81 / 3 = 27$. From this, we deduce that the missing number in the third column (the one with the numbers 13 and 3) is the number 11, because then we will have $11 + 13 + 3 = 27$. Similarly, we deduce that the central number is 9. In the first row, we already have the 1 and the 11. Therefore, the missing number in the top-left corner is 15. Following the argument with the remaining cells, we arrive at the table

| 15 | 1 | 11 |
| :---: | :---: | :---: |
| 5 | 9 | 13 |
| 7 | 17 | 3 |

from which we conclude that $X=7$.

b) There are several possible solutions. One, for example, would be

| 8 | 1 | 6 |
| :--- | :--- | :--- |
| 3 | 5 | 7 |
| 4 | 9 | 2 |