I used a Möbius function formula for Ramanujan’s sums in a previous note and I want to show where this formula comes from in the present note (mainly as a technical memo for myself). The approach will be to show how Ramanujan’s sum
can be derived from a sum of the form
which is like a Dirichlet convolution except that the sum is only over a subset of the divisors of , namely those which also divide .
Formula (1) can be obtained as a special case of (2), via the result
where is the Möbius function. In fact the Möbius function itself is a Ramanujan’s sum, and I showed in Advanced Number Theory Note #10 how to obtain it as a sum of primitive roots of unity like (1) above. It can also be seen directly from (3) by setting , in which case there is only one term in the sum and we get . In addition, when we have and
where the second equality was derived in Advanced Number Theory Note #1.
Focusing on the sum in (2) above, note that occurs only in which is a periodic function with period , so we conclude that must also be a periodic function with period , so that
for all . Therefore must have a finite Fourier expansion, and the precise form of this is obtained in the following theorem.
Theorem 1. Let . Then has the finite Fourier expansion
Proof: We can apply Theorem 4 in Advanced Number Theory Note #9, with the roles of the letters and interchanged, to get the following formula for the coefficients :
We can write for integer (since ) and observe that, since it is required that in the above sum, it must be the case that the index runs from 1 to . Then we have
We can now replace by in the sum on the right without affecting the sum (because both will run over the divisors of ) to get
But by Theorem 1 of Advanced Number Theory Note #9, the sum on is zero unless in which case the sum has the value . Therefore
which proves (5). QED
Now we apply the formula in Theorem 1 with specialised and to obtain the Möbius function formula for Ramanujan’s sums in (3) above (which is the main thing we wanted to derive in this note).
Theorem 2. We have
Proof: Taking and in formula (4) in Theorem 1, we get
where using the formula for in Theorem 1 we get
where the last equality is due to a property of the Möbius function proved in Advanced Number Theory Note #1. Therefore if and if , so we conclude