# Ramanujan's sum

Ramanujan's sum $c_q$ is defined for positive integers $q$ and $n$ by $$c_q(n)=\displaystyle\sum_{a=1,(a,q)=1}^{q} \exp \left( \frac{2 \pi i a n}{q} \right),$$ where $(a,q)$ denotes that $a$ and $q$ are relatively prime and $\exp$ denotes the exponential.