4. Find all pairs of natural numbers whose sum has the last digit 3, the difference is a prime number, and the product is the square of a natural number.

II. round of category A takes place

on Tuesday, January 18, 2005

so that it starts in the morning and the contestants have 4 hours of pure time to solve the problems. For each problem, a contestant can earn 6 points, and a successful solver is a student who scores 10 points or more. Allowed aids are writing and drawing supplies, school MF tables, and calculators without a graphic display. These details will be communicated to the students before the start of the competition.
4. Let $x$ and $y$ be the sought numbers, with $x > y$. Since $p = x - y$ is a prime number and for the greatest common divisor $d$ of the numbers $x$ and $y$ it holds that $d \mid (x - y)$ or $d \mid p$, then either $d = p$ or $d = 1$.

If $d = p$, we would have $y = kp$ and $x = y + p = (k + 1)p$ for some natural number $k$, so the product $xy$ would equal $k(k + 1)p^2$. This is not a square of a natural number (further referred to as a "square") for any $k$, because the number $k(k + 1)$ is never a square. ${ }^{1}$ Therefore, $d$ must be 1, meaning that the numbers $x$ and $y$ are coprime. Their product $xy$ is then a square only if both factors are squares, i.e., $x = u^2$ and $y = v^2$ for some $u, v \in \mathbb{N}, u > v$, from which $p = x - y = (u - v)(u + v)$. Such a factorization of the prime number $p$ has only one possible set of factors $u - v = 1$ and $u + v = p$. From this, it easily follows that $u = \frac{1}{2}(p + 1)$ and $v = \frac{1}{2}(p - 1)$, from which for the sum $s = x + y$ we obtain the expression

$$
s = x + y = u^2 + v^2 = \left(\frac{p + 1}{2}\right)^2 + \left(\frac{p - 1}{2}\right)^2 = \frac{p^2 + 1}{2}.
$$

The decimal representation of the number $s$ ends with the digit 3, so the representation of the number $p^2 + 1$ (equal to the number $2s$) ends with the digit 6. The representation of the number $p^2$ therefore ends with the digit 5, so it is a multiple of five, which occurs only for the prime number $p = 5$. Substituting this value into the derived formulas, we get $u = 3$, $v = 2$, $x = 9$, and $y = 4$. The check is trivial: $9 - 4 = 5$, $9 + 4 = 13$, $9 \cdot 4 = 6^2$.

Answer: The only pair of numbers that satisfy the conditions of the problem is 9 and 4.

For a complete solution, award 6 points. For the justification that the sought numbers $x$ and $y$ are coprime, award 2 points; 1 point for noting that from the coprimality of the numbers $x, y$ it follows that $x = u^2$ and $y = v^2$; 1 point for justifying the relation $u - v = 1$; and finally 2 points for the discussion of divisibility by 5 leading to the determination of the value of the prime number $p = 5$. If the solver does not earn any partial points for the above items but guesses the result, award 1 point. The obvious fact that the number $k(k + 1)$ is not a square can be used without proof. However, if there is no mention of the need for a check, award no more than 5 points.

1 It holds that $k^2 < k(k + 1) < (k + 1)^2$, so the number $k(k + 1)$ lies between two consecutive squares. Another explanation can be based on the fact that the numbers $k, k + 1$ are coprime, so both would have to be squares differing by 1. Such squares do not exist.