Kluyver's Formula for Ramanujan's Sum

Theorem
For $q \in \N$, $n \in \N\cup\{0\}$ let $c_q(n)$ be Ramanujan's sum.

Let $\mu$ be the Mobius function. Then:


 * $\displaystyle c_q(n) = \sum_{d | \gcd(q,n)} d \mu \left( \frac qd \right)$

Proof
Let $\zeta_q$ be a primitive $q^\text{th}$ root of unity, and: