## Task 4.

Determine all numbers $k \in \mathbb{N}$ such that

$$
\frac{m+n}{m^{2}-k m n+n^{2}}
$$

is not a composite natural number for any choice of $m, n \in \mathbb{N}$.
## Solution.

Let $k \in \mathbb{N}$ be the number with the desired property. If we substitute $(m, n)=(k, 1)$, we get

$$
\frac{m+n}{m^{2}-k m n+n^{2}}=\frac{k+1}{k^{2}-k^{2}+1}=k+1
$$

By substituting $(m, n)=\left(k^{2}+k-1, k+1\right)$, we get

$$
\frac{m+n}{m^{2}-k m n+n^{2}}=\frac{k^{2}+2 k}{\left(k^{2}+k-1\right)^{2}-\left(k^{2}+k\right)\left(k^{2}+k-1\right)+(k+1)^{2}}=k
$$

Therefore, the numbers $k$ and $k+1$ are not composite. Since exactly one of them is even, it follows that $k=1$ or $k=2$.

For $k=1$, we have $\frac{m+n}{m^{2}-m n+n^{2}} \leqslant 2$, so the desired expression is never a composite natural number. Indeed,

$\frac{m+n}{m^{2}-m n+n^{2}} \leqslant 2 \Longleftrightarrow m+n \leqslant 2\left(m^{2}-m n+n^{2}\right) \Longleftrightarrow 0 \leqslant(m-n)^{2}+m(m-1)+n(n-1)$, and the last inequality clearly holds.

For $k=2$, we get the expression $\frac{m+n}{(m-n)^{2}}$, and we see that by substituting, for example, $m=5$ and $n=4$, the expression takes the composite value 9.

Thus, we have shown that $k=1$ is the only number with the desired property.