## Task 2 - 260832

Determine all pairs $(p ; q)$ of prime numbers that satisfy the following conditions (1), (2), (3)!

(1) The difference $q-p$ is greater than 0 and less than 10.

(2) The sum $p+q$ is the square of a natural number $n$.

(3) If you add the number $n$ to the sum of $p$ and $q$, you get 42.
I. If a pair $(p ; q)$ of prime numbers together with a natural number $n$ satisfies conditions (1), (2), (3), then:

From (2) we have $p+q=n^{2}$, and from (3) we have $n+p+q=42$. Therefore, due to the previous equation, $n+n^{2}=42$, i.e., $n(n+1)=42$ (4).

The only ways to express 42 as a product of two natural numbers are (disregarding the order of the factors) $42=1 \cdot 42=2 \cdot 21=3 \cdot 14=6 \cdot 7$.

Among these representations, only $6 \cdot 7$ contains two factors of the form $n$ and $n+1$, so from (4) (for natural numbers $n$) it follows that $n=6$.

From (2) it follows that $p+q=36$. Therefore, $p$ is one of the prime numbers less than 36, i.e., one of the numbers 2, $3,5,7,11,13,17,19,23,29,31$, and $q$ is respectively one of the numbers 34, 33, 31, 29, 25, $23,19,17,13,7,5$.

Of these possibilities, all except $p=17, q=19$ are eliminated, as for them either $q-p \geq 10$ or $q-p6$ is $n(n+1)>6 \cdot 7$.

Therefore, among the natural numbers $n$, only $n=6$ can satisfy the equation $n(n+1)=42$.

2. With knowledge of the solution formula for quadratic equations (or by derivation, for example, using $\left.\left(n+\frac{1}{2}\right)^{2}-\frac{1}{4}=42\right)$, we obtain:

Of the two solutions

$$
n_{1 ; 2}=-\frac{1}{2} \pm \sqrt{\frac{1}{4}+42}=\frac{1}{2}(-1 \pm 13)
$$

of the quadratic equation $n^{2}+n-42=0$, only $n_{1}=6$ is a natural number.