## Task A-3.5.

Determine all natural numbers $n$ for which the value of the expression

$$
\frac{n^{2}-22+\log _{2} n}{n-5}
$$

is an integer.
## Solution.

The initial fraction can be written in the following way

$$
\frac{n^{2}-22+\log _{2} n}{n-5}=\frac{n^{2}-25+\log _{2} n+3}{n-5}=n+5+\frac{\log _{2} n+3}{n-5}
$$

Since $n+5$ is an integer, for the above fraction to be an integer, the fraction $\frac{\log _{2} n+3}{n-5}$ must also be an integer.

In particular, the number $k:=\log _{2} n$ in the numerator of that fraction must be a rational number. Since the number $n=2^{k}$ is natural, this is only possible if $k$ is a non-negative integer.

By substituting $n=2^{k}$, we get that

$$
\frac{\log _{2} n+3}{n-5}=\frac{k+3}{2^{k}-5}
$$

must be an integer.

By checking the cases $k=0,1,2$ and 3, we find that the fraction $\frac{k+3}{2^{k}-5}$ is an integer only for $k=2$ and $k=3$.

For $k \geqslant 4$, $2^{k}-5>k+3$ (since the exponential function grows faster than the linear function), so in this case, the above fraction cannot be an integer.

Therefore, $n=2^{2}=4$ and $n=2^{3}=8$ are the only solutions for which the initial fraction is an integer.