The numbers $p$ and $q$ are prime and satisfy

$$
\frac{p}{p+1}+\frac{q+1}{q}=\frac{2 n}{n+2}
$$

for some positive integer $n$. Find all possible values of $q-p$.
Origin. Luxembourg (Pierre Haas).
Rearranging the equation, $2 q n(p+1)=(n+2)(2 p q+p+q+1)$. The left hand side is even, so either $n+2$ or $p+q+1$ is even, so either $p=2$ or $q=2$ since $p$ and $q$ are prime, or $n$ is even.

If $p=2,6 q n=(n+2)(5 q+3)$, so $(q-3)(n-10)=36$. Considering the divisors of 36 for which $q$ is prime, we find the possible solutions $(p, q, n)$ in this case are $(2,5,28)$ and $(2,7,19)$ (both of which satisfy the equation).

If $q=2,4 n(p+1)=(n+2)(5 p+3)$, so $n=p n+10 p+6$, a contradiction since $n1$ if and only if $q \mid p+1$.

Since $(\ell, \ell+1)$, we see that, if $q \nmid p+1$, then $\ell=p q+p+1$ and $\ell+1=q(p+1)$, so $q=p+2$ (and $\left(p, p+2,2\left(2 p^{2}+6 p+3\right)\right)$ satisfies the original equation). In the contrary case, suppose $p+1=r q$, so $\ell(p+1)=(\ell+1)(p+r)$, a contradiction since $\ell<\ell+1$ and $p+1 \leq p+r$.

Thus the possible values of $q-p$ are 2,3 and 5.