Ramanujan’s sums are sums of powers of primitive roots of unity of the form
where is a fixed positive integer and here we are summing the -th powers of the primitive -th roots of unity. Ramanujan showed that these sums are always integers, using the following equivalent expression for them (which I will derive in detail in a later note):
Here, is the Möbius function. Sometimes it is necessary to sum these over , but this can get very tedious if the form in (1) above is used. In this short note, which is mainly intended as a technical memo for myself, I want to give a detailed derivation of a more convenient formula for finding sums of Ramanujan’s sums, using the form in (2). I will also give a couple of brief illustrative examples. (It is not hugely difficult, but I am not aware of any explicit derivation of this formula in the literature, and I found the process instructive).
Noting that (2) can be written equivalently as
and summing over from 1 to we get
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
is the one required.
To illustrate its use, suppose we are given . Then we have , and so, for example,
We can also compute sums of Ramanujan’s sums to an unspecified limit if we know the residue class to which belongs modulo some number. For example, when , we have . When (mod 4) we have , where denotes an integer. Then: