Exercise 10. Find all triplets ( $\mathbf{p , q , r} \mathbf{)}$ ) of prime numbers such that the 3 differences

$$
|p-q|,|q-r|,|r-p|
$$

are also prime numbers.
Solution to Exercise 10: Note that the three numbers must be pairwise distinct since 0 is not a prime number. We can therefore assume, without loss of generality, that $\mathrm{p}>\mathrm{q}>\mathrm{r}$. A prime number is either odd or equal to 2.

Suppose that $p, q$, and $r$ are all odd. Then $p-q, q-r$, and $r-p$ are even. Since their absolute values are prime, these numbers must all be 2. Thus, the integers $p, p+2$, and $p+4$ are all prime. If $p$ is divisible by 3, then $p=3$ and $\mathrm{q}=5$ and $\mathrm{r}=7$.

However, the triplet $(3,5,7)$ is not a solution to the problem: $7-3=4$ is not prime.

If $p$ is not divisible by 3, then $p$ is of the form $3k+1$ or $3k+2$. The first case implies that $p+2$ is divisible by 3, so $p+2=3$ but $p=1$ is not a prime number. The second case implies that $p+4$ is divisible by 3, but $p+4=3$ does not yield a positive solution.

Suppose that $r=2$. Then $p$ and $q$ are odd and $p-q$ is even and prime, so it must be 2. It follows that $\mathrm{q}+2$, $\mathrm{q}$, and $\mathrm{q}-2$ are all prime. From the previous case, this implies that $q-2=3$ so $p=7$. Conversely, the triplet $(p, q, r)=(2,5,7)$ and its permutations are indeed solutions to the problem.

The only triplets that are solutions are therefore $(2,5,7)$ and its permutations.

Graders' Comments

Many students had the main ideas but lost points for poor writing. It is always important to verify that the solutions obtained satisfy the statement of the problem. Some students claimed without any justification that if $p, p+2$, and $p+4$ are prime, then $p=3$. Similarly, some said that $|p-q|=|q-r|=|r-p|=2$ is impossible without justifying it, which was quite clear (we can assume $p>q>r$ for example). It is better to detail the important points a bit more to avoid losing points.