Problem: The numbers $p$ and $q$ are prime and satisfy
\[ \frac{p}{p+1} + \frac{q+1}{q} = \frac{2n}{n+2} \]
for some positive integer $n$.
Find all possible values of $q-p$.

Solution: We clean up the numerators as
\[ \left( 1-\frac{1}{p+1} \right) + \left( 1 + \frac{1}{q} \right) = 2 - \frac{4}{n+2} \]
which simplifies as
\[ \frac{4}{n+2} = \frac{1}{p+1} - \frac{1}{q} \]
which reduces as
\[ \frac{4}{n+2} = \frac{q-p-1}{q(p+1)} \]
At this point $n$ is a free parameter.
So, this motivates us to rewrite the equation as
\[ n+2 = \frac{4q(p+1)}{(q-p)-1}. \]
This implies that $q-p-1 \mid 4q(p+1)$.
Since $n$ is positive, we have $0 < q-p-1 < q$.
Because $q$ is prime, this implies $q-p-1 \mid 4(p+1)$.
But now $q-p-1 \mid 4(p+1) + 4(q-p-1) = 4q$.
Again, $q$ is prime, so $q-p-1 \mid 4$.
This implies $q-p \in \left\{ 2,3,5 \right\}$.

It is easy to construct working examples: say $(p,q)$ is $(3,5)$, $(2,5)$ and $(2,7)$.