<s>[INST] Proving $\sum_{k=1}^{n}\cos\frac{2\pi k}{n}=0$ I want to prove that the below equation can be held.

$$\sum_{ k=1 }^{ n  } \cos\left(\frac{  2 \pi k }{  n  } \right) =0, \qquad n>1 $$

Firstly I tried to check the equation with small values of $n$
$$  \text{As } n=2 $$
$$  \cos\left(\frac{  2 \pi \cdot 1   }{  2  } \right) + \cos\left(\frac{  2 \pi \cdot 2   }{  2   } \right)  $$
$$ = \cos\left(\pi\right)  + \cos\left(2 \pi\right)    $$
$$ = -1+ 1 =0  ~~ \leftarrow~~ \text{Obvious}  $$
But
$$  \text{As}~~ n=3  $$
$$  \cos\left(\frac{  2 \pi \cdot  1   }{  3   } \right) +\cos\left(\frac{  2 \pi  \cdot  2   }{  3   } \right) + \cos\left(\frac{  2 \pi  \cdot  3   }{  3   } \right)  $$
$$ = \cos\left(\frac{  2 \pi  }{  3  } \right) + \cos\left(\frac{  4 \pi  }{  3  } \right) + \cos\left( 2\pi \right)  $$
$$ = \cos\left(\frac{  2 \pi  }{  3  } \right) + \cos\left(\frac{  4 \pi  }{  3  } \right) + 1  =?$$
What formula(s) or property(s) can be used to prove the equation?
 [/INST] Observe that
$$\sum_{k=1}^n\cos(\frac{2\pi k}{n})=\operatorname{Re}\left(\sum_{k=1}^ne^{\frac{2\pi ki}{n}}\right).$$
Consider the sum
$$\sum_{k=1}^ne^{\frac{2\pi ki}{n}}=\sum_{k=1}^n(e^{\frac{2\pi i}{n}})^k$$
and use the fact that
$$1+\sum_{k=1}^n r^k =\frac{1-r^{n+1}}{1-r}$$
to show it's zero.
</s>