
NT12 Solve the equation $\frac{p}{q}-\frac{4}{r+1}=1$ in prime numbers.


## Solution

We can rewrite the equation in the form

$$
\begin{gathered}
\frac{p r+p-4 q}{q(r+1)}=1 \Rightarrow p r+p-4 q=q r+q \\
p r-q r=5 q-p \Rightarrow r(p-q)=5 q-p
\end{gathered}
$$

It follows that $p \neq q$ and

$$
\begin{gathered}
r=\frac{5 q-p}{p-q}=\frac{4 q+q-p}{p-q} \\
r=\frac{4 q}{p-q}-1
\end{gathered}
$$

As $p$ is prime, $p-q \neq q, p-q \neq 2 q, p-q \neq 4 q$.

We have $p-q=1$ or $p-q=2$ or $p-q=4$

i) If $p-q=1$ then

$$
q=2, p=3, r=7
$$

ii) If $p-q=2$ then $p=q+2, r=2 q-1$

If $q=1(\bmod 3)$ then $q+2 \equiv 0(\bmod 3)$

$$
q+2=3 \Rightarrow q=1
$$

contradiction.

If $q \equiv-1(\bmod 3)$ then $r \equiv-2-1 \equiv 0(\bmod 3)$

$$
\begin{gathered}
r=3 \\
r=2 q-1=3 \\
q=2 \\
p=4
\end{gathered}
$$

contradiction.

Hence $q=3, p=5, r=5$.

iii) If $p-q=4$ then $p=q+4$.

$r=q-1$

Hence $q=3, p=7, r=2$.

