The sums of primitive roots are always whole
Worth reading first: The sums that obey a smaller equation · The polygon an equation forces.
A root of unity of order is one that returns to after exactly multiplications and no fewer. Of the solutions of , the ones of order exactly are the primitive ones: with sharing no factor with . There are of them, Euler’s totient.
The polygon an equation forces found that the primitive -th roots add up to a very small number: , or , according to the Möbius function of . Here is the generalisation Srinivasa Ramanujan wrote down in 1918. Raise every primitive -th root to the same power before adding:
Each term is a point on the unit circle. There is no evident reason for the sum to be anything in particular.
And yet it is always a whole number. For the eight primitive roots, raised to the first power, trace an irregular octagonal walk that ends at . Raised to the third power they end at ; to the fifth, at ; to the fifteenth, all eight land on and the walk runs straight out to . The sums are Ramanujan’s sums, and this essay is about why they are whole, what formula they obey, and what Ramanujan used them for.
Why the sum cannot be anything but whole
The reason is the one the sums that obey a smaller equation gave for Gauss’s periods, and Ramanujan’s sum is in fact the coarsest period of all.
Raising a root of unity to a power that shares no factor with sends primitive roots to primitive roots — it multiplies each exponent by , and still shares no factor with — and it sends distinct roots to distinct roots. So it permutes the set of primitive -th roots. The same map applied to the sum permutes its terms, and leaves the sum unchanged. The sum is therefore fixed by every symmetry of the field generated by a primitive -th root, and a number in that field fixed by every symmetry is rational.
It is also a sum of roots of unity, and so an algebraic integer; a rational algebraic integer is a whole number. The same argument applies with the exponent in place of , for any fixed , so every is whole. The figures check it independently: each sum is added numerically and required to lie within a hundred-millionth of an integer, with an imaginary part that vanishes because the primitive roots come in conjugate pairs.
The smallest cases can be done in the head. The primitive fourth roots are and , and they add to ; squared, both become , and the sum is ; raised to the fourth power, both become , and the sum is . The primitive sixth roots are , whose imaginary parts cancel and whose real parts add to ; squared, they become the primitive cube roots , which add to . In each case the irrational parts — , — are paired off by complex conjugation or by a larger symmetry, and only a whole number is left.
In the language of periods, is the single period that uses the whole group — every primitive root in one coset — evaluated at the root . A period of index one has an equation of degree one, and an equation of degree one with whole-number coefficients has a whole-number root.
A prime, where there are only two answers
When is a prime , every root except is primitive, and there are only two cases.
If does not divide , raising to the -th power shuffles the non-trivial roots among themselves, and their sum is always the same: the full sum of all roots is , so the non-trivial ones add to . If divides , every root is sent to and the sum is . So
The walk for a prime is the regular polygon walked out of order: raising to the power visits the vertices of the heptagon two at a time, raising to three at a time, and every such order closes up one step short of the origin.
The table, and the formula behind it
For a composite the values are more varied, but the pattern is visible in a table.
Three things stand out, and all three are forced.
Each row is periodic in with period , because depends on only modulo .
Each row reaches its maximum exactly at the multiples of , where every term is .
Each row depends on only through . Row reads and then repeats; the value at equals the value at because both share exactly with . The reason is the permutation argument once more: multiplying by a number coprime to only permutes the terms of the sum.
The closed form, found by Robert von Sterneck in 1902 and independently by Otto Hölder, writes the value directly. With ,
Every entry in every figure is checked against it. For and , , , and , so — the walk in the first figure that ends two units to the left of the origin.
A second formula, a sum over the common divisors, shows the structure differently:
It comes from the fact that the sum of all -th roots raised to the -th power is if divides and otherwise — the filter that every third coefficient used to pick out terms of a polynomial — combined with Möbius inversion to strip off the roots of smaller order.
Thirty, built from two, three and five
When has several prime factors, the sum splits along them.
The Ramanujan sum is multiplicative in : if and share no factor, then for every . The reason is the Chinese remainder theorem. A primitive -th root of unity is, uniquely, a product of a primitive -th root and a primitive -th root, so the sum over primitive -th roots is the product of the two smaller sums.
So is a product of three prime cases, each of which takes only two values. For : since , since , and since ; the product is , and the eight-step walk for ends four units to the right. For , , , , and the product is . Every value in the table is a product of numbers of the form or , with the correction for prime powers that von Sterneck’s formula carries: is unless divides , which is why the rows for , and are mostly empty.
That is also why the sums are so much smaller than they might be. Eight unit vectors could add to anything up to in length; for they reach that length only when divides — at the multiples of , at the odd multiples of — and otherwise stay within of the origin. The primitive roots are spread so evenly round the circle that most of them cancel, and what survives is decided prime by prime.
The rows are orthogonal, like sines and cosines
The table’s rows are more than periodic. Take two different rows, and , multiply them entry by entry over a common period — any multiple of both and — and add. The answer is exactly .
The figure’s table is checked this way for every pair of rows up to twelve, over a period of . When the same sum is , never zero. That is the defining property of an orthogonal family, the property the sines and cosines of a Fourier series have: and multiplied and integrated over a period give nought unless .
The analogy is exact in one direction. A function of that depends only on modulo can be written as a combination of the rows for the divisors of — provided it depends on only through , the functions called even modulo . The Ramanujan sums are the Fourier basis for such functions, with divisibility playing the part of frequency: a row is a “tone” that repeats every steps.
Rebuilding the sum of divisors
Ramanujan’s paper of 1918 used the analogy in the other direction. An arithmetic function like , the sum of the divisors of , is not periodic at all. But Ramanujan found that it can still be expanded in the , exactly as a non-periodic signal is expanded in sines of every frequency:
For , a prime, the terms are unless divides ; the series is with a correction at every multiple of , and it settles on . For it settles on — six is perfect, so its divisors add to twice itself — and for on .
The factor is , the value of that sums of powers, read off a staircase places among the even zeta values, and it enters because the average of over all is exactly that. The Ramanujan sums supply the deviation of each particular from the average. A function defined by divisibility is being written as a superposition of sums of roots of unity, each of which encodes one divisibility test.
The expansion also makes the special numbers visible. A number whose divisors add to exactly twice itself, like or , has , so its Ramanujan series sums to exactly ; the numbers whose divisors add to three times themselves, which divisors that add to three times the number catalogued, have series summing to . The series does not make such numbers easier to find — each term needs , and so knowledge of the factors of — but it says in what sense being perfect is a statement about how sits against every modulus at once: each term records whether , or a part of it, divides , and the weights make the small moduli count most.
Ramanujan gave several such expansions in the same paper, among them one for the number of divisors, , which converges only conditionally, and one for the number of ways of writing as a sum of two squares.
A sum that is nought, and the primes
The most striking of Ramanujan’s identities is the simplest to state:
For the terms are , and the statement becomes
which Edmund Landau showed in 1899 to be equivalent to the prime number theorem — the statement, followed in counting what has no formula, that the primes up to number about . The equivalence runs through the product Euler wrote for the zeta function, the sieve written as a product: the reciprocal of that product is the series , and its value at is the sum in the figure. The figure’s curves approach nought slowly and irregularly, and the slowness is honest: the rate at which approaches its limit is controlled by the zeros of the Riemann zeta function, and an estimate good enough to settle the Riemann hypothesis would be a statement about exactly this kind of curve.
So a sum of roots of unity, weighted by , contains the distribution of the primes. That is the surprising connection Ramanujan’s sums make, and it is not a coincidence of notation: the Möbius function is the sum of the primitive roots, and the Möbius function is the device by which counting primes is turned into analysis.
Where the sums are used now
The sums found their largest use in the circle method of Hardy, Littlewood and Ramanujan himself, the technique for counting the ways of writing a number as a sum of primes or of powers.
When the method predicts how many ways a large even number can be written as a sum of two primes, the prediction has two factors. One is smooth, about . The other, the singular series, adjusts for divisibility: it is larger when has many small prime factors, because then fewer residue classes are ruled out. The singular series is a sum over of Ramanujan’s sums weighted by the square of — one term per modulus, each asking how sits relative to the multiples of . The predicted counts match computation to high accuracy for every even number anyone has checked, though the prediction itself remains unproved.
In signal processing, the rows of the table have been used since the 2010s as a basis for detecting hidden periods in integer-valued sequences, since they are integer-valued and orthogonal and a period of shows up as energy in the rows with .
What the walks and tables cannot show
The integrality is checked, then proved. Each drawn sum is computed as a sum of floating-point cosines and required to be within of a whole number; each also agrees with von Sterneck’s closed form. The proof is the permutation argument, which the figures do not show.
The expansions are drawn only to finitely many terms. The partial sums of at sixty terms are within a few thousandths of their targets, and the partial sums of at three thousand terms are within a hundredth of nought. Neither is a proof of convergence. Ramanujan’s expansion of converges absolutely and the proof is short; the one for lies at the depth of the prime number theorem, and the figure is only a picture of it.
The analogy with Fourier series is exact only for functions that are even modulo . For general arithmetic functions, when a Ramanujan expansion exists, whether it is unique is a subtle question, and some functions have expansions of different kinds that converge to the same values.
Still open: how fast the Möbius sums settle
The sum tends to nought, and the prime number theorem is equivalent to that. How fast it tends to nought is not known. If the Riemann hypothesis is true, the partial sums shrink faster than for every positive ; the best unconditional bound, from the zero-free region of the zeta function, is much weaker: it shrinks like up to smaller factors — faster than any power of , but slower than any power of .
The same holds for the unweighted sums , Mertens’s function, which how evenly the fractions spread met as the measure of how evenly the Farey fractions fill the interval: the Riemann hypothesis is equivalent to growing no faster than . Franz Mertens conjectured in 1897 that always; Andrew Odlyzko and Herman te Riele disproved that in 1985 without exhibiting a counterexample, and the smallest where it fails is still unknown. The curves in the last figure are the gentlest possible view of the same unknown.
A sum that forgets everything but a divisor
The habit worth keeping is to ask what a sum is invariant under.
Eight points on a circle, added, could land anywhere. Because they are all the primitive roots of one order, every symmetry of the number system shuffles them among themselves, and the sum has nowhere to go but the whole numbers. Raising them to a power keeps that property and adds one more: the answer can see only what shares with . Invariance under shuffling made the sums whole; invariance under coprime scaling made them depend only on a divisor; and those two facts together are what let Ramanujan write the sum of divisors, and the distribution of the primes, in terms of roots of unity.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- On the circle and never home — both name cyclotomic polynomial, roots of unity
- The sums of roots of unity that add to nothing — both name cyclotomic polynomial, roots of unity
Named objects
A dashed tag is an object no other essay names yet.
Cyclotomic polynomialFourier seriesGreatest common divisorMobius functionPrime number theoremRoots of unityTotient