Primes and the Ramanujan sum. How can I go about proving Ramanujan's sum in terms of a prime $p$, so 
\begin{equation}
    C_p(n)=
    \begin{cases}
      -1, & \text{if $p$ does not divide $n$} \\
      p-1, & \text{if  } p\mid n.
    \end{cases}
  \end{equation}
I am not sure exactly how to analyze this sum.
 A: Source http://www.imsc.res.in/~rao/ramanujan/CamUnivCpapers/Cpaper21/page1.htm
Ramanujan defines $$c_s(n) = \sum_{\lambda} \cos\left(\frac{2 \pi \lambda n}{s}\right)$$ where $\lambda$ ranges of values from $1$ to $s$ that are coprime to $s$.
Clearly then $$c_p(pk)=\sum_{\lambda} 1$$ for $p-1$ different values of $\lambda$.
Now if $p \not \mid m$ $$c_p(m) = \sum_{\lambda} \cos\left(\frac{2 \pi \lambda m}{p}\right) = \sum_{\lambda} \cos\left(\frac{2 \pi \lambda}{p}\right) = \Re \left[\sum_{\alpha} \alpha \right] = \sum_{\alpha} \alpha$$ the first two sums being the same since multiplication by a unit $\lambda$ just permutes the terms around, and the last sums ranging over the primitive roots of $\alpha^p-1=0$, therefore the sum is $-1$ by Vieta.
It can also be deduced quicker once you have the properties of $\eta$.
A: Under the section Kluyver of the wikipedia entry, there is a derivation of the formula
$$c_q(n) = \sum_{d|(q,n)} \mu \left( \frac{q}{d} \right) d$$
using Möbius inversion. Putting $q = p$ immediately gives you the result you need.
