## 15. ILLUSTRATIVE EXERCISE

Find all ordered triples of positive integers $(p, q, n)$ such that $p, q$ are primes and $p^{2}+q^{2}=p q n+1$.

SOLUTION
15. Suppose $p=q$. Substituting we get $p^{2}(2-n)=1$ which is impossible because 1 is not divisible by any prime. Therefore, $p$ and $q$ must be different; since the equation is symmetric in $p$ and $q$ we can assume that $q>p$, i.e., $q \geq p+1$. Let's now write our equation as:

$$
p^{2}-1=p q n-q^{2}=q(p n-q) \text {. }
$$

This means that $p^{2}-1$ is a multiple of $q$ and thus $q$ is a prime divisor of $p^{2}-1$. Therefore,

$$
q \mid p^{2}-1=(p-1)(p+1) .
$$

Now, since $q$ is a prime number, it must be present either in the factorization of $p-1$ or in that of $p+1$; in both cases $q \leq p+1$. By the initial assumption, we had $q \geq p+1$ and thus we get that $q=p+1$. Among two consecutive numbers, one must necessarily be even and therefore is 2 (the only even prime) and the other is necessarily 3 since 1 is not prime. Now let's check if the equation can be solved for $n$ by substituting $p=2$ and $q=3$:

$$
4+9=6 n+1,
$$

from which $n=2$. The only two solutions are therefore $(2,3,2)$ and $(3,2,2)$.