Which way a prime's two squares point
Worth reading first: Two squares, and a lattice · A fraction on the circle forces a whole point.
Thirteen is . Seventeen is , twenty-nine is , thirty-seven is , forty-one is . Every prime that leaves a remainder of one on division by four is a sum of two squares, and the rule that decides which primes are also says the two squares are unique: once the larger is written first and signs are ignored, there is exactly one pair. So each such prime comes with a single point , with , sitting on the circle of radius .
A point on a circle has a direction. Seventeen’s point lies almost flat, fourteen degrees above the horizontal; forty-one’s point is nearly on the diagonal, at thirty-nine degrees. The question this essay asks is the most naive one available: which way do the primes face? Is there a favoured direction — do primes prefer to be one large square plus a small one, or two squares of about the same size — or does every direction get its fair share?
The answer is that every direction gets its fair share, exactly. Erich Hecke proved it in two papers published in 1918 and 1920, and the proof is a copy, in a new setting, of the argument that puts infinitely many primes into every arithmetic progression. The figures below measure the theorem on the seventy-four thousand primes of this kind below two million — and find something the theorem does not say.
One point for each prime
Draw the point for every prime one more than a multiple of four, below twenty thousand.
The points fill a wedge, one-eighth of a disc. Their density thins slowly outwards, which is the primes thinning — a number near is prime with chance about , and that is all the radial fading is. Around each circle there is no visible pattern at all. No ray through the origin is crowded with points, and none is empty.
That absence is the whole content of Hecke’s theorem, and it is worth saying why it is not obvious. The points are lattice points: whole-number coordinates. The lattice points on circles are rigidly arranged, and their arrangement is invisible from the outside — the question of whether is prime depends on and in a way that has nothing to do with angles. There could perfectly well have been a bias. Primes are odd, so and have opposite parity; primes are not multiples of three, so and are not both multiples of three. Every such condition is a restriction on the lattice, and each could, in principle, favour some directions over others. The figure says that none does, at least visibly, at this size.
There is also a reason to expect evenness, and stating it shows what has to be proved. The number of lattice points in a wedge of the disc of radius is about the wedge’s area, , so whole-number points are spread over directions in proportion to angle. If primality were a coin tossed independently for each point — with the right bias, of the squared radius — then primes would inherit that evenness. Hecke’s theorem says the coin really does behave as if it ignores direction, which is a statement about primes and not about lattices.
Why a sector and not the whole circle
The wedge from nought to forty-five degrees is not an arbitrary choice; it is what the arithmetic leaves after its symmetries are removed.
The cleanest way to see it is through the Gaussian integers, the numbers with and whole. In them, a prime splits as , and the norm is the squared distance from the origin. A prime that factors this way has its factor determined only up to two kinds of ambiguity. Multiplying by the units , , rotates the factor by a right angle without changing anything that matters, so the factor’s angle is really only defined modulo ninety degrees. And swapping a factor for its conjugate reflects the angle in the horizontal. Together those eight operations — four rotations, each with or without a reflection — carry the point to and , and exactly one of the eight lies between the horizontal and the diagonal.
So the sector is the circle with its symmetry quotiented out, and evenness in the sector is the same statement as evenness of the Gaussian prime factors around the whole circle. That matters for the proof, because it is the Gaussian factors, not the folded angles, on which Hecke’s method runs. And it matters for the measurement, because a prime’s angle is now a number between and with nothing further to adjust: one prime, one angle.
No direction is preferred
Seventy-four thousand primes are enough to measure the claim rather than eyeball it. Cut the sector into forty-five bands of one degree each and count how many primes below two million land in each.
The bands sit within a few per cent of their share, and there is no trend across the sector — no slope from the horizontal to the diagonal, no hump in the middle. Note the vertical scale: it runs from six per cent short to six per cent over, and an even spread over seventy-four thousand points, divided into forty-five bands of about sixteen hundred each, would be expected to wander by about two and a half per cent per band from chance alone. The departures drawn here are the size of noise.
One band is visibly short: the first, below one degree, at three per cent under. That is not a bias in the primes but a fact about small numbers. A point with angle below one degree needs , and with at least one that forces , so no prime below about can contribute to that band at all. The sliver nearest the axis opens late, and over a range that begins at five it starts behind. The same effect, much smaller, shortens the band nearest the diagonal, where must be strict. Both are effects of the range having a floor, and both shrink as the range grows.
It is worth registering how different this is from the question of how many numbers are sums of two squares at all. That count drifts, slowly and provably, towards a share of nothing; no finite computation shows its limit. The angles have no such drift. Whatever the slow corrections to the count of primes in a sector are, they are the same correction in every sector, and they cancel when one sector is compared with another.
Remainders and angles, one theorem
Hecke’s proof is the reason this essay sits where it does, and it is a precise imitation of a proof that is a century older.
Dirichlet’s theorem says that primes fall evenly into the allowed remainders modulo any number — a quarter of all large primes end in each of the digits 1, 3, 7 and 9. Dirichlet’s method attaches to each remainder class a set of characters: functions that turn a remainder into a complex number of size one and respect multiplication, . From each character he built a series , which factors over primes just as the zeta function does. The averages of over primes are what decide whether the primes are evenly spread among the remainders, and those averages tend to nought exactly because no is zero at .
An angle is a remainder that varies continuously. The direction of a Gaussian integer is a number modulo ninety degrees, and multiplying two Gaussian integers adds their angles, just as multiplying two numbers multiplies their remainders. So the functions that respect this multiplication are , where is the angle, for every whole number — the factor four makes them indifferent to the units. These are Hecke’s Größencharaktere, characters that measure size and direction. From each he built an L-function, proved that it continues past the line where its series stops converging and that it has no zero on that line, and drew the conclusion Dirichlet had drawn: the average of each character over the primes tends to nought.
That those averages decide evenness is Hermann Weyl’s criterion, from 1916. For the folded angle in the sector it reads: the angles are evenly spread exactly when, for every , the average of over the primes tends to nought. The cosines are what is left of once each prime’s factor is paired with its conjugate. The first four can be measured.
All four fall, and they fall together. At two million each is about one part in a thousand. The figure shows four of an infinite list, and the theorem is that the list ends nowhere: however rapid the oscillation — , swinging a hundred times across the sector — its average over the primes eventually goes to nought too. The picture can show the first few. Only the L-functions handle all of them at once, which is why the result is Hecke’s and not a computation’s.
The parallel with the prime number theorem runs one level deeper. The count of primes below is governed by the zeta function, and the proof that the count is asymptotically right is, at its core, the proof that zeta has no zero on the line . Hecke’s theorem is the same statement for each of his L-functions. The angles are evenly spread for exactly the reason the primes are as numerous as they are.
Measured against chance
Evenness is a statement about the limit. It says nothing about how quickly the counts settle, and that is where the measurements found something the theorem does not predict.
The natural yardstick is the discrepancy: list the angles, and for each compare the share of them below with the share an even spread would have; the discrepancy is the largest difference. It is the measure used for the fractions with bounded denominator, where its rate of decay is equivalent to the Riemann hypothesis. For independent random angles it is about on average — that number is the mean of Kolmogorov’s limiting distribution, and it is the size against which any set of points can be called more or less even than chance.
The primes’ discrepancy sits below the random line at every one of the eight bounds, and the ratio holds steady: scaled by , it reads at a thousand primes and stays between and from ten thousand to two million, against for random draws. The cosine averages in the previous figure say the same from another side. For random angles, the average of has typical size about ; the primes’ averages sit between a fifth and a third of at the largest bounds.
So the angles are not merely even in the limit and random in their fluctuations. At every size measured, they are more even than chance. The statement is about the range that was computed, and the factor near two is a measurement rather than a theorem; no result in the literature this essay draws on predicts it. Part of it is certainly the lattice showing through. Lattice points in a sector are not random at all — their count is the sector’s area with an error far smaller than random fluctuation would give — and primes are a thinning of those points by a rule blind to direction. A thinned lattice keeps some of the lattice’s regularity, and the rate at which that inherited regularity is diluted as the primes thin out is not something these eight bounds can settle. A set of points chosen to be more even than random is exactly what a numerical integrator wants. The primes, it seems, supply such points for free.
Thin sectors fill late
Hecke’s theorem is about a fixed sector — any interval of angles, chosen once, then held while the primes grow. What happens when the sector is very narrow?
A nine-degree sector holds its share from the start: 128 primes against a prediction of 122 below ten thousand, 14,872 against 14,883 below two million. A sector of a ninth of a degree is empty below ten thousand, where one and a half primes were expected, and then catches up: 183 against 184 at two million. Every row converges. The narrower the sector, the later it settles — a sector that holds few points at a given size is at the mercy of how those few fall.
That is all the theorem promises, and it raises the sharper question that matters more. A sector that is fixed is eventually filled. What about a sector that shrinks as the primes grow — one whose width is a power of , so that for primes near it is very thin indeed? The theorem’s proof comes with an error term, and an error term says how narrow a sector can be while its count is still guaranteed to be right; that guarantee reaches only sectors much wider than the ones in the bottom rows of the table. Asking for less — not the full share, only infinitely many primes — reaches further. Jonas Kubilius in the 1950s was the first to put primes into sectors whose width is a negative power of , and Glyn Harman and Paul Lewis proved in 2001, by sieve methods rather than L-functions alone, that infinitely many primes have below — that is, an angle below about .
The thinnest sector of all
Push the sector as thin as it can go and keep at one. Then , and its point lies at angle about , the smallest angle any lattice point on that circle can have short of the axis itself. Asking whether this sliver holds infinitely many primes is asking whether infinitely many primes are one more than a square.
All four counts rise steadily: 152 primes of the form below two million, 168 of the form , 102 of the form and 161 of the form . The gaps between them have plain explanations. and must have even, or they are even themselves; and must have odd. And is a multiple of three whenever is, which removes a third of its candidates outright — the curve drawn lowest. Conditions of exactly this kind are what the primes on Ulam’s spiral line up along, and the heuristic of Hardy and Littlewood turns them into a predicted count for each polynomial. For the prediction is about times the count for random numbers of the same size, and it matches every computation ever made.
It is not proved. Whether infinitely many primes are one more than a square was the fourth of the problems Edmund Landau listed at the International Congress in 1912 as unattackable by the methods of his day, and it remains open. The nearest results go round it. Henryk Iwaniec proved in 1978 that is infinitely often a prime or a product of two primes. John Friedlander and Iwaniec proved in 1998 that infinitely many primes are — a sum of two squares in which the second is itself a square, so that the points are sparse in a different way. Neither reaches .
So the sector picture sets the problem in a scale. Hecke places infinitely many primes in every fixed sector. Harman and Lewis place infinitely many in sectors as thin as . Landau’s problem is the sector of width — the thinnest the lattice allows. The distance between those exponents is the distance between what is known and what is believed.
Two million primes standing in for all of them
The figures count to two million, and each claim they illustrate is about all primes. That every fixed sector receives exactly its share in the limit is Hecke’s theorem and is proved; the figures show it happening, not that it must. Weyl’s criterion needs every cosine average to tend to nought, and the figure draws four of infinitely many, each over a finite range.
The observation that the angles are more even than random is the opposite case: it is visible in every figure and proved nowhere here. Its factor of two holds across eight bounds spanning three orders of magnitude, and nothing in the computation says whether it is permanent, slowly fading, or a feature of the particular range. The neighbouring fact — that the count of lattice points in a wedge is far more regular than random — suggests a mechanism, and turning a suggestion into a statement about primes would take control of the L-functions’ zeros well beyond what the equidistribution proof needs.
And nothing in a figure can show that the sector of width one square holds infinitely many primes. One hundred and fifty-two below two million is evidence of exactly the kind that has been accumulating since Euler, and Landau’s problem is open because no amount of it is proof. The picture locates the problem precisely — at the bottom edge of the wedge, in the sliver of width — and stops there.
Still open: how thin a sector a prime must visit
The quantitative form of Hecke’s theorem is the open edge. It is conjectured that a sector of width , for any , eventually holds its share of primes. Even the Riemann hypothesis for every one of Hecke’s L-functions, used in the standard way, guarantees the share only in sectors far wider than that, because a narrow sector needs many characters at once and each brings its own error. Proved results place infinitely many primes — not their share — in sectors down to . Between the two lie all the questions about primes in thin sectors, and at the far end lies , which is Landau’s problem.
A second question is about the size of the fluctuations rather than the reach of the theorem. Ze’ev Rudnick and Ezra Waxman studied the variance of the number of prime angles in small sectors and proposed, on the evidence of a random-matrix model, how it should behave as the sector shrinks; their conjecture predicts departures from pure randomness in a specific range of widths. The discrepancy measured here is a single number per bound, and it is consistent with fluctuations that are smaller than random; whether it fits their model or reveals something else would take the computation to much larger bounds and to many more sector widths than are drawn here.
The question that started this — which way do the primes face — has a simple answer and a hard edge. Every way, evenly. And the evenness is finer than chance at every size anyone has looked, which nobody has yet explained.
The circle that decides
Seen from far enough back, this is the third time the same circle has answered a question about primes by turning it into geometry. The first rule decided which primes lie on a lattice circle, and the answer came from remainders modulo four. The descent showed that a rational point on the circle forces a lattice point, by a reflection that never mentions primes. Here the direction of the lattice point turns out to be a remainder too — a continuous one — and the evenness of primes among remainders, which Dirichlet proved for progressions, carries over to directions on the circle with the same proof in a new key.
That carrying-over is why Hecke’s characters became the template for much of twentieth-century number theory. Almost every equidistribution theorem about primes since — primes in progressions, in sectors, in the remainders a quadratic form allows, in the angles of elliptic curves — has the same skeleton: name the symmetry, write down its characters, build an L-function from each, and show that none of them vanishes where it would have to for a bias to survive. The wedge of points in the first figure is the simplest picture of what that skeleton proves. Every direction is visited, in proportion, by primes that were never told which way to point.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- The two supplements, and where the eight comes from — both name gaussian integers, primes, sums of two squares
- The wait for the next sum of two squares — both name lattice, primes, sums of two squares
- A factorisation that hides its primes — both name dirichlet theorem, primes
- Counting one rectangle, twice — both name lattice, primes
- Factoring uniquely with no way to divide — both name gaussian integers, lattice
- How many pairs can be one apart — both name lattice, sums of two squares
Named objects
A dashed tag is an object no other essay names yet.
Dirichlet theoremDiscrepancyEquidistributionGaussian integersLatticePrimesSums of two squares