Let $z$ and $w$ be two complex numbers such that $w=z \bar{z}-2 z+2,\left|\frac{z+i}{z-3 i}\right|=1$ and $\operatorname{Re}(w)$ has minimum value. Then, the minimum value of $n \in N$ for which $w^n$ is real, is equal to ______.
Numerical-value question: the answer is a number.
Show answer
The answer is 4.
Key from source paper