Exercise 4. Let $n \geqslant 3$ be an integer. For each pair of prime numbers $p$ and $q$ such that $p<q \leqslant n$, Morgane has written the sum $p+q$ on the board. She then notes $\mathcal{P}(n)$ as the product of all these sums. For example, $\mathcal{P}(5)=(2+3) \times(2+5) \times(3+5)=280$.

Find all values of $n \geqslant 3$ for which $n$ ! divides $\mathcal{P}(n)$.

Note: If two sums $p+q$ formed from two different pairs are equal to each other, Morgane writes them both. For example, if $n=13$, she writes both sums $3+13$ and $5+11$.
Solution to Exercise 4 Let $n$ be a potential solution, and let $r$ be the largest prime number such that $r \leqslant n$. Since $r$ divides $n$!, it divides $\mathcal{P}(n)$, so there exist two prime numbers $p$ and $q$ such that $p<q \leqslant n$ and $r$ divides $p+q$. By the maximality of $r$, we know that $p+q<2 r$, so $p+q=r$. Since $q$ and $r$ are odd, $p$ is therefore even, and $p=2$.

Similarly, there exist two prime numbers $s$ and $t$ such that $s<t \leqslant n$ and $q$ divides $s+t$. We will prove that $q-2$ is prime. Indeed, if $t \leqslant q$, then $s+t=q$, so $s=2$ and $t=q-2$. Otherwise, $t=r=q+2$, so $q<t+s<2 q+2<3 q$, which means $t+s=2 q$ and $s=q-2$.

In particular, 3 divides one of the three prime numbers $q-2, q$ and $q+2$; it must necessarily be $q-2$, which means that $q-2=3$ and $q+2=r=7$. Thus, $n \geqslant 7$, and $n$! divides

$$
\mathcal{P}(n)=(2+3) \times(2+5) \times(2+7) \times(3+5) \times(3+7) \times(5+7)=2^{6} \times 3^{3} \times 5^{2} \times 7
$$

Since $2 \times 4 \times 6 \times 8=2^{7} \times 3$ does not divide $\mathcal{P}(n)$, we must have $n=7$.

Conversely, $n=7$ is indeed a solution, as $7!=2^{4} \times 3^{2} \times 5 \times 7$.

Graders' Comments The exercise was rarely attempted; it's a pity, as a number of students had good ideas. However, as mentioned in the comments on Problem 5, the writing was problematic: do not hesitate to look at the comments on Problem 5 to see various recurring errors.

## Senior Problems