# Ramanujan’s sum

Jordan Bell
April 7, 2014

## 1 Definition

Let $q$ and $l$ be positive integers. Define

 $c_{q}(l)=\sum_{\stackrel{{\scriptstyle 1\leq j\leq q}}{{\gcd(h,q)=1}}}e^{-2\pi ihl% /q}=\sum_{\stackrel{{\scriptstyle 1\leq h\leq q}}{{\gcd(h,q)=1}}}e^{2\pi ihl/q% }=\sum_{\stackrel{{\scriptstyle 1\leq h\leq q}}{{\gcd(h,q)=1}}}\cos\frac{2\pi hl% }{q}.$

$c_{q}(l)$ is called Ramanujan’s sum.

## 2 Fourier transform on $\mathbb{Z}/q$ and the principal Dirichlet character modulo $q$

For $F:\mathbb{Z}/q\to\mathbb{C}$, the Fourier transform $\widehat{F}:\mathbb{Z}/q\to\mathbb{C}$ of $F$ is defined by

 $\widehat{F}(k)=\frac{1}{q}\sum_{j\in\mathbb{Z}/q}F(j)e^{-2\pi ijk/q},\qquad k% \in\mathbb{Z}/q.$

Define $\chi:\mathbb{Z}/q\to\mathbb{C}$ by $\chi(j)=1$ if $\gcd(j,q)=1$ and $\chi(j)=0$ if $\gcd(j,q)>1$. $\chi$ is called the principal Dirichlet character modulo $q$. The Fourier transform of $\chi$ is

 $\widehat{\chi}(k)=\frac{1}{q}\sum_{j\in\mathbb{Z}/q}\chi(j)e^{-2\pi ijk/q}=% \frac{1}{q}\sum_{\stackrel{{\scriptstyle 1\leq j\leq q}}{{\gcd(j,q)=1}}}e^{-2% \pi ijk/q}.$

Therefore we can write Ramanujan’s sum $c_{q}(l)$ as $c_{q}(l)=q\cdot\widehat{\chi}(l)$, thus $c_{q}=q\cdot\widehat{\chi}$.

The above gives us an expression for $c_{q}(l)$ as a multiple of the Fourier transform of the principal Dirichlet character modulo $q$. $c_{q}:\mathbb{Z}/q\to\mathbb{C}$, and we can write the Fourier transform of $c_{q}$ as

 $\displaystyle\widehat{c_{q}}(k)$ $\displaystyle=$ $\displaystyle\frac{1}{q}\sum_{j\in\mathbb{Z}/q}c_{q}(j)e^{-2\pi ijk/q}$ $\displaystyle=$ $\displaystyle\sum_{j\in\mathbb{Z}/q}\widehat{\chi}(j)e^{-2\pi ijk/q}.$

## 3 Dirichlet series

Here I am following Titchmarsh in §1.5 of his The theory of the Riemann zeta-function, second ed. Let $\mu$ be the Möbius function. The Möbius inversion formula states that if

 $g(q)=\sum_{d|q}f(d)$

then

 $f(q)=\sum_{d|q}\mu\left(\frac{q}{d}\right)g(d).$

($\sum_{d|q}$ is a sum over the positive divisors of $q$.)

Define

 $\eta_{q}(k)=\sum_{j\in\mathbb{Z}/q}e^{-2\pi ijk/q}.$

We have (this is not supposed to be obvious)

 $\eta_{q}(k)=\sum_{d|q}c_{d}(k).$

Therefore by the Möbius inversion formula we have

 $c_{q}(k)=\sum_{d|q}\mu\left(\frac{q}{d}\right)\eta_{d}(k).$

(Hence $|c_{q}(k)|\leq\sum_{d|k}d=\sigma_{1}(k)$, where $\sigma_{a}(k)=\sum_{d|k}d^{a}$.)

If $q|k$ then $\eta_{q}(k)=q$, and if $q\not|k$ then $\eta_{q}(k)=0$. (To show the second statement: multiply the sum by $e^{-2\pi ik/q}$, and check that this product is equal to the original sum. Since we multplied the sum by a number that is not $1$, the sum must be equal to $0$.) Thus we can express the Möbius function using Ramanujan’s sum as $\mu(q)=c_{q}(1)$.

Because $\eta_{d}(k)=d$ if $k|d$ and $\eta_{d}(k)=0$ if $k\not|d$, we have

 $c_{q}(k)=\sum_{d|q,d|k}\mu\left(\frac{q}{d}\right)d=\sum_{dr=q,d|k}\mu(r)d.$

So

 $\frac{c_{q}(k)}{q^{s}}=\sum_{dr=q,d|k}\frac{1}{q^{s}}\mu(r)d=\sum_{dr=q,d|k}% \frac{1}{d^{s}r^{s}}\mu(r)d=\sum_{dr=q,d|k}\frac{1}{r^{s}}\mu(r)d^{1-s}.$

Therefore

 $\sum_{q=1}^{\infty}\frac{c_{q}(k)}{q^{s}}=\sum_{q=1}^{\infty}\sum_{dr=q,d|k}% \frac{1}{r^{s}}\mu(r)d^{1-s}=\sum_{r=1}^{\infty}\sum_{d|k}\frac{1}{r^{s}}\mu(r% )d^{1-s}=\sum_{r=1}^{\infty}\frac{1}{r^{s}}\mu(r)\sum_{d|k}d^{1-s}.$

Then

 $\sum_{q=1}^{\infty}\frac{c_{q}(k)}{q^{s}}=\sigma_{1-s}(k)\sum_{r=1}^{\infty}% \frac{1}{r^{s}}\mu(r)=\sigma_{1-s}(k)\frac{1}{\zeta(s)};$

here we used that

 $\frac{1}{\zeta(s)}=\sum_{n=1}^{\infty}\frac{\mu(n)}{n^{s}}.$

On the other hand, if rather than sum over $q$ we sum over $k$, then we obtain

 $\displaystyle\sum_{k=1}^{\infty}\frac{c_{q}(k)}{k^{s}}$ $\displaystyle=$ $\displaystyle\sum_{k=1}^{\infty}\frac{1}{k^{s}}\sum_{d|q,d|k}\mu\left(\frac{q}% {d}\right)d$ $\displaystyle=$ $\displaystyle\sum_{d|q}\sum_{m=1}^{\infty}\frac{1}{(md)^{s}}\cdot\mu\left(% \frac{q}{d}\right)d$ $\displaystyle=$ $\displaystyle\sum_{d|q}\sum_{m=1}^{\infty}\frac{1}{m^{s}}\cdot\frac{1}{d^{s}}% \cdot\mu\left(\frac{q}{d}\right)d$ $\displaystyle=$ $\displaystyle\sum_{m=1}^{\infty}\frac{1}{m^{s}}\sum_{d|q}\frac{1}{d^{s}}\mu% \left(\frac{q}{d}\right)d$ $\displaystyle=$ $\displaystyle\zeta(s)\cdot\sum_{d|q}\mu\left(\frac{q}{d}\right)d^{1-s}.$