4. Let's call different natural numbers $m$ and $n$ related if the sum of the smallest natural divisor of $m$, different from 1, and the largest natural divisor of $m$, different from $m$, equals $n$, and the sum of the smallest natural divisor of $n$, different from 1, and the largest natural divisor of $n$, different from $n$, equals $m$. Find all pairs of related numbers. (20 points)
Solution: Let $S(x)$ and $L(x)$ denote the smallest natural divisor of $x$ different from 1 and the largest natural divisor of $x$ different from $x$, respectively. It is clear that $x \neq$ 1, since in this case $S(x)$ and $L(x)$ do not exist. Any related pair $m$ and $n$ is a solution to the system

$$
\left\{\begin{array}{l}
S(m)+L(m)=n \\
S(n)+L(n)=m
\end{array}\right.
$$

Without loss of generality, we will assume that $n>m$. Note that if a number $x$ is prime, then $S(x)=x, L(x)=1$. This means that the numbers $m$ and $n$ cannot both be prime. Indeed, in that case $n=m+1$ and $m=n+1$, which is impossible.

If the number $m$ is prime, then $S(m)=m, L(m)=1$ and thus $n=m+1$. As proven, the number $n$ cannot be prime, so $n$ is composite and $L(n) \neq 1, S(n) \neq n$. If $L(n)n$.

## Answer: 5 and 6