Exercise 11. Noémie and Tristan are shepherds. Each has a number of sheep that is a perfect square, that is, an integer that can be written in the form $n^{2}=n \times n$ with $n$ a positive or non-negative integer. We therefore denote $a^{2}$ as the number of sheep Noémie has and $b^{2}$ as the number of sheep Tristan has. After a quick count of the total number of sheep, they deduce that $97 \leqslant a^{2}+b^{2} \leqslant 108$. Determine the number of sheep each has, knowing that:

1. Noémie has strictly more sheep than Tristan;
2. each of them has at least 2 sheep;
3. the total number of sheep $a^{2}+b^{2}$ is odd.
## Solution to Exercise 11

Note that $a^{2} \leqslant 108$ so $a \leqslant 10$. Furthermore, $97 \leqslant a^{2}+b^{2} \leqslant 2 a^{2}$ because Noémie has more sheep than Tristan, so $a^{2} \geqslant 48.5$, and since $a^{2}$ is an integer, $a^{2} \geqslant 49$ thus $a \geqslant 7$. Therefore, there are only a few cases to consider:

$\triangleright$ If $a=7, 97 \leqslant 49+b^{2} \leqslant 108$ so $48 \leqslant b^{2} \leqslant 59$. Since $b^{2} \leqslant a^{2}=49$, we can try to bound $b^{2}$ between two perfect squares: we have $3616=b^{2}$ and $a^{2}+b^{2}=97$ is indeed odd and between 97 and 108, so $(81,16)$ is a solution.

$\triangleright$ If $a=10, 97 \leqslant 100+b^{2} \leqslant 108$ so $b^{2} \leqslant 8$. Therefore, $b^{2}<9$, so $b<3$. In particular, $b=0,1$ or 2. If $b=0$ or $1, b^{2}<2$, so Tristan has strictly fewer than 2 sheep, which is impossible. If $b=2, a^{2}+b^{2}=104$ which is even, which is impossible, so there is no solution.

Thus, we obtain that Noémie has 81 sheep and Tristan has 16.