Exercise 3. We say that a strictly positive integer $n$ is amusing if for every strictly positive divisor $d$ of $n$, the integer $d+2$ is prime. Determine all the amusing integers that have the maximum number of divisors.
Solution to Exercise 3: Let $n$ be an amusing integer and $p$ a prime divisor of $n$. Then $p$ is odd, since $p+2$ is prime.

Suppose that $p \geqslant 5$. Then $p+2$ is prime, and $p+2>3$, so $p+2$ is not divisible by 3. We deduce that $p$ is not congruent to 1 modulo 3. It is clear that $p$ is not congruent to 0 modulo 3, so $p \equiv 2(\bmod 3)$. Suppose that $p^{2} \mid n$. Then $p^{2} \equiv 1(\bmod 3)$, so $p^{2}+2 \equiv 0$ $(\bmod 3)$. Furthermore, $p^{2}+2$ is prime, so $p^{2}+2=3$, which is impossible.

From the above, we deduce that if $p \geqslant 5$ is a prime divisor of $n$, then $p^{2}$ does not divide $n$.

Similarly, if $p_{1}$ and $p_{2}$ are distinct prime divisors $\geqslant 5$ of $n$, then $p_{1} p_{2}$ divides $n$, so $p_{1} p_{2}+2$ is divisible by 3, which is impossible.

Therefore, any amusing integer $n$ is of the form $n=3^{k}$ or $3^{k} p$ where $p$ is prime.

We verify that $3+2, 3^{2}+2, 3^{3}+2$, and $3^{4}+2$ are prime, but $3^{5}+2$ is not, so $k \leqslant 4$. The amusing integers of the form $3^{k}$ therefore have at most 5 divisors.

If $n=3^{4} \times 5=405$, then $n+2$ is not prime, so $n$ is not amusing.

If $n=3^{k} p$ with $p \geqslant 7$ prime, and $k \geqslant 3$, then the numbers $p, 3 p, 9 p, 27 p$ are divisors of $n$ congruent to $p, 3 p, 4 p, 2 p$ modulo 5. None is congruent to 0 modulo 5, and the congruences of these four numbers modulo 5 are distinct, so in some order they are $1, 2, 3, 4$. We deduce that there exists a divisor $d \geqslant 7$ of $n$ such that $d \equiv 3(\bmod 5)$. We have $d+2>5$ and $5 \mid d$, which implies that $d$ is not prime.

From the above, we deduce that the amusing integers of the form $3^{k} p$ satisfy $k \leqslant 2$ or $(k \leqslant 3$ and $p=5)$, so they have at most 8 divisors, with equality only when $k=3$ and $p=5$. Conversely, we verify that $3^{3} \times 5$ is amusing, so the unique amusing integer with a maximum number of divisors is $3^{3} \times 5=135$.