Find all possible integer values of $n$ such that the following system of equations has a solution for $z$: \begin{align*} z^n &= 1, \\ \left(z + \frac{1}{z}\right)^n &= 1. \end{align*}
I've been working on this problem for a few hours now and I haven't made much progress, does anyone have any ideas on how to progress and get an answer? $z$ is supposed to be a complex number in exponential form, so $e^{i\pi}$.
SIDENOTE: I'm a precalculus student.
hint
Put $$z=re^{it}$$
$z $ is a root of the first equation if $$r=1;\; \text{ and } \; t=\frac{2k\pi}{n}$$
or $$z=e^{i\frac{2k\pi}{n}}$$ thus $ z+\frac 1z $ is a real. the same $ z $ satisfies the second equation if $z+\frac 1z=1=2\cos(\frac{2k\pi}{n}) $
which gives
$$\frac{2k\pi}{n}=\pm \frac{\pi}{3}+2K\pi$$ and $$n=\frac{6k}{\pm 1+6K}$$
$$\text{ or }$$
$z+\frac 1n=-1$ and $ n =2p$ even which gives
$$\frac{k\pi}{p}=\pm \frac{2\pi}{3}+2K\pi$$ and $$n=\frac{3k}{\pm 2+3K}$$
we conclude that necessarily, $ n $ should be of the form $$n=6k, \;\;k\in \Bbb Z$$