## Task A-1.1.

Determine all triples $(p, q, r)$ of prime numbers for which $p q + r = 1 + r p + q r$.
## Solution.

If all three numbers $p, q$, and $r$ are odd, the expression on the left side is even, while the right side is odd. Therefore, at least one of the numbers must be even, which is only possible if one of them is 2. We consider three cases: $p=2, q=2$, and $r=2$.

If $p=2$, by substitution and expansion we have

$$
\begin{gathered}
2 q+r=1+2 r+q r \\
q r+r-2 q=-1 \\
r(q+1)-2(q+1)=-1-2 \\
(q+1)(r-2)=-3
\end{gathered}
$$

Since $q$ and $r$ are primes, they are at least 2, so on the left side we have the product of non-negative numbers, while on the right side we have a negative number. This leads to a contradiction, so there are no solutions in this case.

The case $q=2$ is symmetric to the case $p=2$, so there are no solutions in this case either.

If $r=2$, by substitution and expansion we get

$$
\begin{gathered}
p q+2=1+2 p+2 q \\
p q-2 p-2 q=-1 \\
p(q-2)-2(q-2)-4=-1 \\
(p-2)(q-2)=3
\end{gathered}
$$

On the left side, we again have the product of non-negative numbers. The number 3 is prime, so it can only be factored as $3=1 \cdot 3$, which leaves two possibilities. If $p-2=3$ and $q-2=1$, then $p=5$ and $q=3$. If $p-2=1$ and $q-2=3$, then $p=3$ and $q=5$. In both cases, $p$ and $q$ are prime numbers.

We conclude that the solutions are $(p, q, r)=(3,5,2)$ and $(p, q, r)=(5,3,2)$.