## Task B-4.6.

How many natural numbers $n$ less than 2022 are there for which $\left(\frac{-\sqrt{2}+i \sqrt{2}}{2 \cos \frac{\pi}{8}-2 i \sin \frac{\pi}{8}}\right)^{n}$ is a real number?
## Solution.

Let $z=\frac{-\sqrt{2}+i \sqrt{2}}{2 \cos \frac{\pi}{8}-2 i \sin \frac{\pi}{8}}$.

The trigonometric form of the numerator of $z$ is

$-\sqrt{2}+i \sqrt{2}=2\left(\cos \frac{3 \pi}{4}+i \sin \frac{3 \pi}{4}\right)$

and the denominator

$2 \cos \frac{\pi}{8}-2 i \sin \frac{\pi}{8}=2\left(\cos \left(-\frac{\pi}{8}\right)+i \sin \left(-\frac{\pi}{8}\right)\right)=2\left(\cos \frac{15 \pi}{8}+i \sin \frac{15 \pi}{8}\right)$.

Then we have

$$
\begin{aligned}
z & =\cos \left(\frac{3 \pi}{4}-\frac{15 \pi}{8}\right)+i \sin \left(\frac{3 \pi}{4}-\frac{15 \pi}{8}\right)=\cos \left(-\frac{9 \pi}{8}\right)+i \sin \left(-\frac{9 \pi}{8}\right) \\
& =\cos \left(\frac{7 \pi}{8}\right)+i \sin \left(\frac{7 \pi}{8}\right)
\end{aligned}
$$

Then $z^{n}=\cos \left(\frac{7 \pi n}{8}\right)+i \sin \left(\frac{7 \pi n}{8}\right)$.

This number is real if $\sin \left(\frac{7 \pi n}{8}\right)=0$, that is, if $\frac{7 \pi n}{8}=k \pi, k \in \mathbb{Z}$.

It follows that $n=\frac{8 k}{7}, k \in \mathbb{Z}$.

Since $n$ is a natural number, $k$ must be a positive multiple of 7, and $n$ a multiple of 8, i.e., $n \in\{8,16,24, \ldots, 2016\}$.

Finally, there are 252 such natural numbers $n$.