How many elements of order $n$ does $\bigcup_n^\infty\{e^{\frac{2ik\pi}{n}}:0\leq k\leq n-1\}$ have? I came across a question which I though I managed to solve. After looking at the official solution for it I got very confused.
The Question
$H=\bigcup_{n=2}^\infty\{e^{\frac{2ik\pi}{n}}:0\leq k\leq n-1\}$
for $n\ge1$ how many elements of order $n$ does $H$ have?
My Thoughts
Since I know $e^{i\pi}=-1$, I concluded that $H=\{1, -1, i, -i\}$ and solved it like that.
The Expected Answer
Apparently $H$ is the group of all (or some) finite unity roots so the answer is $\phi(n)$ (Euler's identity)
What I don't understand
Is where are all the other members coming from? Am I wrong to think $H=\{1, -1, i, -i\}$? I would really appreciate some insights of this. Thanks

Edit:
My thinking is that if every $h \in H$ is $(e^{\pi i})^\frac{2k}{n}$ for some $n,k$ and $e^{\pi i}=-1$ I assumed that every $h \in H$ is $(-1)^\frac{2k}{n}$ which can only be $1,-1,i,-i$
 A: Reading the comments, it looks like you main source of confusion is the following line:

I think this is the part I don't understand. How could it have more than $4$ if for every $k,n$ then $(e^{i\pi})^{\frac{2k}n}$ is $−1,1,i,−i$

The main problem is that $\frac{2k}n$ is not necessarily an integer, so you can't conclude that $(-1)^{\frac{2k}n}$ is one of $1,-1,i,-i.$ It's not obvious for example what $(-1)^{\frac13}$ or $(-1)^{\frac14}$ is.
In fact that quantity isn't a-priori well-defined! For an integer $n,$ we would like $w = z^{1/n}$ to be the complex number such that $w^n=z.$ However for $1^{1/4}$ we have four candidates; $1,-1,i,-i.$ You might argue the natural choice is to take $w=1,$ but there isn't a natural choice for general $z.$
We usually define complex exponentiation by first defining,
$$ e^z = \sum_{n=0}^{\infty} \frac{z^n}{n!}. $$
We can also define $z^w = e^{w \log z},$ but this involves 'choosing a branch of the logarithm' since there is not natural choice for that, for similar reasons to above.
Subtle issues aside, for $x$ real we have the formula,
$$e^{ix} = \cos x + i \sin x$$
which you've hopefully seen before. Using this it should be clear that $H$ is a rather complicated group.
A: Roots of unity come up in the first year course I teach. As a pro. geometric group theorist, I think they are interesting because:


*

*it is one of the first points in the course where groups are studied (although the word "group" is not used, unless I am feeling particularly excitable during the lecture!), and

*it is a place where geometry and algebra come together to give a deeper understanding of the topic.
Lets generalise a bit, which will hopefully make things clearer: you want to find all the n$^{th}$ roots of a complex number $a$, and so as not to generalise too much lets assume $|a|=1$. Well, as $|a|=1$ there exists some angle $\theta$ such that.
$$
\begin{align*}
a&=\cos(\theta)+i\sin(\theta)\\
&=\cos(\theta\color{red}{+2k\pi})+i\sin(\theta\color{red}{+2k\pi})~~~~~~\text{this is the weird step!}\\
\end{align*}
$$
Now, by de Moivre's theorem, if $x^n=a$ then $x$ has the form:
$$
x=\cos\left(\frac{\theta+2k\pi}{n}\right)+i\sin\left(\frac{\theta+2k\pi}{n}\right)
$$
It is then easy to see, with a bit of trig knowledge, that the complex number $a$ has precisely $n$ distinct roots.
In your example, $a=1$ so $\theta=0$ and your roots are:
$$
\begin{align*}
x_0&=\cos\left(0\right)+i\sin\left(0\right)=1&(k&=0)\\
x_1&=\cos\left(\frac{2\pi}{n}\right)+i\sin\left(\frac{2\pi}{n}\right)&(k&=1)\\
&\vdots\\
x_{n-1}&=\cos\left(\frac{2(n-1)\pi}{n}\right)+i\sin\left(\frac{2(n-1)\pi}{n}\right)&(k&=n-1)
\end{align*}
$$
For example, if $n=3$ then your roots are:
$$
\begin{align*}
x_0&=\cos\left(0\right)+i\sin\left(0\right)\\
&=1\\
x_1&=\cos\left(\frac{2\pi}{3}\right)+i\sin\left(\frac{2\pi}{3}\right)\\
&=-\frac{1}{2}+i\frac{\sqrt3}{2}\\
x_2&=\cos\left(\frac{4\pi}{3}\right)+i\sin\left(\frac{4\pi}{3}\right)\\
&=-\frac{1}{2}-i\frac{\sqrt3}{2}
\end{align*}
$$
Note that none of $-1$, $i$ or $-i$ are cube roots of $1$. Now, at the start of this post I mentioned that geometry and algebra somehow "combine" in this setting. Well, if we plot the three above numbers on the complex plain we get an equilateral triangle! Indeed, this is always the case: if you plot the n$^{th}$ roots of unity on the complex plane you get the vertices of a regular n-gon.
A: $H$ is the (cyclic) group of $n$-th roots of unity in $\mathbf C$. This group has order $n$, and  elements of order $n$ are the generators of this group.
Now if a cyclic group of  order $n$ is generated by $g$ so that all elements of $G$ can be written as $g^k$, $k$ being unique modulo $n$, do you know for which values of $k$ $g^k$ is also a generator of $G$?
