
1. Find all pairs of primes $p, q$ for which there exists a positive integer a such that

$$
\frac{p q}{p+q}=\frac{a^{2}+1}{a+1}
$$

(Ján Mazák, Róbert Tóth)


Solution. First, we will deal with the case when the wanted primes $p$ and $q$ are distinct. Then, the numbers $p q$ and $p+q$ are relatively prime: the product $p q$ is divisible by two primes only (namely $p$ and $q$ ), while the sum $p+q$ is divisible by neither of these primes.

We will look for a positive integer $r$ which can be a common divisor of both $a+1$ and $a^{2}+1$. If $r \mid a+1$ and, at the same time, $r \mid a^{2}+1$, then $r \mid(a+1)(a-1)$ and also $r \mid\left(a^{2}+1\right)-\left(a^{2}-1\right)=2$, so $r$ can only be one of the numbers 1 and 2 . Thus the fraction $\frac{a^{2}+1}{a+1}$ either is in lowest terms, or will be in lowest terms when reduced by two, depending on whether the integer $a$ is even, or odd.

If $a$ is even, we must have

$$
p q=a^{2}+1 \quad \text { and } \quad p+q=a+1
$$

The numbers $p, q$ are thus the roots of the quadratic equation $x^{2}-(a+1) x+a^{2}+1=0$, whose discriminant

$$
(a+1)^{2}-4\left(a^{2}+1\right)=-3 a^{2}+2 a-3=-2 a^{2}-(a-1)^{2}-2
$$

is apparently negative, so the equation has no solution in the real numbers.

If $a$ is odd, we must have (taking into account the reduction by two)

$$
2 p q=a^{2}+1 \quad \text { and } \quad 2(p+q)=a+1
$$

The numbers $p, q$ are thus the roots of the quadratic equation $2 x^{2}-(a+1) x+a^{2}+1=0$, whose discriminant is negative as well.

Therefore, there is no pair of distinct primes $p, q$ satisfying the conditions.

It remains to analyze the case of $p=q$. Then,

so we must have

$$
\frac{p \cdot q}{p+q}=\frac{p \cdot p}{p+p}=\frac{p}{2}
$$

$$
p=\frac{2\left(a^{2}+1\right)}{a+1}=2 a-2+\frac{4}{a+1} ;
$$

this is an integer if and only if $a+1 \mid 4$, i. e. $a \in\{1,3\}$, so $p=2$ or $p=5$.

To summarize, there are exactly two pairs of primes satisfying the conditions, namely $p=q=2$ and $p=q=5$.
