The Möbius function is the sum of the primitive $n$th roots of unity. [duplicate]

It is true that the Möbius function $\mu(n)$ is the sum of the primitive $n$th roots of unity.

Perhaps the easiest way to see this is to write $$ \sum_{(k, n) = 1} e^{2\pi i k / n} = \sum_{k = 1}^n \sum_{d \mid (k,n)} \mu(d) e^{2 \pi i k / n} = \sum_{d \mid n} \mu(d) \sum_{\ell = 1}^{n/d} e^{2 \pi i d \ell / n}.$$ We get the first equality by using the property $$ \sum_{d \mid n} \mu(d) = \begin{cases} 1 & \text{ if } n = 1 \\ 0 & \text{ else } \end{cases},$$ and we get the second equality by swapping the orders of summation. In the final expression, the inner summation is a sum of all the $(n/d)$th roots of unity, and thus is zero except in the case when it's trivial, which occurs when $d = n$. So the only surviving term is $\mu(n)$, and we've shown $$ \sum_{(k,n) = 1} e^{2 \pi i k / n} = \mu(n),$$ as you wanted to show. $\diamondsuit$


A slightly different approach goes like this: introduce

$$\alpha(n) = \sum_{k=1,\; (k,n)=1}^n \exp(2\pi i k/n).$$

Then we have

$$\sum_{k=1}^n \exp(2\pi i k/n) = [[n=1]] = \sum_{d|n} \sum_{(k,n)=d} \exp(2\pi i k/n) \\ = \sum_{d|n} \sum_{(k/d,n/d)=1} \exp(2\pi i (k/d)/(n/d)) = \sum_{d|n} \alpha(n/d).$$

Now from the relation

$$\sum_{d|n} \alpha(n/d) = [[n=1]]$$

we may conclude that $\alpha(n) = \mu(n)$ by inspection.

If this is not sufficient use Mobius inversion to get

$$\alpha(n) = \sum_{d|n} \mu(d) [[n/d=1]] = \mu(n).$$