Number

The two supplements, and where the eight comes from

The main law relates two odd primes to each other and says nothing about −1 or about 2. Those two are settled separately, by their own counts, and the answers arrive modulo four and modulo eight — which is a clue about where the whole subject is really taking place.

Worth reading first: Counting one rectangle, twice · Two dials at once.

The law of quadratic reciprocity is a statement about two odd primes, and it has a hole in the middle of it exactly where the most useful cases live.

The two supplements, and the residue classes that decide them. A table of odd primes with the Legendre symbols of minus one and two beside the residue of p modulo four and modulo eight.
Fig. 1 Fourteen odd primes with the Legendre symbols of −1 and of 2 beside the residue of p modulo four and modulo eight. Every symbol is computed by Euler’s criterion, predicted from the residue class, and counted a third time as folds by Gauss’s lemma; the figure refuses to draw unless all three agree at every row.

To evaluate (ap)\left(\frac{a}{p}\right) for a general aa, the practical route is to factor aa and use that the symbol is multiplicative — (abp)=(ap)(bp)\left(\frac{ab}{p}\right) = \left(\frac{a}{p}\right)\left(\frac{b}{p}\right) — so the whole problem reduces to the symbols of the primes dividing aa, and to the symbol of 1-1 when aa is negative. The main law handles an odd prime against an odd prime. It says nothing whatever about 1-1, because 1-1 is not a prime, and nothing about 22, because the rectangle the proof counts has (p1)/2(p-1)/2 by (q1)/2(q-1)/2 points in it and q=2q = 2 makes one side empty.

So two cases are left over, and they are called the supplements. They are not corollaries. Each needs its own count, and the two counts do not look alike.

Half the residues, and the criterion that sorts them

Before either supplement, one fact about the ground they stand on. Among the p1p-1 non-zero residues modulo an odd prime, exactly half are squares. That is not a numerical coincidence: squaring is two-to-one on the non-zero residues, since xx and x-x have the same square and nothing else does, so the image has exactly (p1)/2(p-1)/2 elements.

Multiplication on a dial of 13. Multiplication on a dial of 13. The modulus is prime, so every non-zero row is a rearrangement of all the residues.
Fig. 2 Multiplication modulo thirteen, as a table. The squares are the entries on the diagonal, and there are six of them among the twelve non-zero residues — half, as the two-to-one argument requires.

Euler’s criterion turns that structural fact into a test. Raising a non-zero residue to the power (p1)/2(p-1)/2 gives an element whose square is ap1=1a^{p-1} = 1, so the answer is +1+1 or 1-1, and it is +1+1 exactly for the squares. The reason is that the non-zero residues form a cyclic group: pick a generator gg, write a=gka = g^k, and a(p1)/2=gk(p1)/2a^{(p-1)/2} = g^{k(p-1)/2} is 11 exactly when kk is even, which is exactly when aa is a square.

So the Legendre symbol is a homomorphism from the non-zero residues onto {+1,1}\{+1, -1\}, and that single sentence is where multiplicativity comes from. A group of residues drawn as a cycle makes the picture immediate: the squares are the even positions round the cycle, and a product of two odd positions is even.

Everything below is the same criterion evaluated at two particular values of aa, and the interest is entirely in how the answers depend on pp.

The first supplement, in one line

Euler’s criterion says that (ap)a(p1)/2(modp)\left(\frac{a}{p}\right) \equiv a^{(p-1)/2} \pmod p. Put a=1a = -1 and the right-hand side is (1)(p1)/2(-1)^{(p-1)/2}, which is +1+1 when (p1)/2(p-1)/2 is even and 1-1 when it is odd.

That is the whole argument. (p1)/2(p-1)/2 is even exactly when p1p - 1 is divisible by four, so

(1p)=+1    p1(mod4).\left(\frac{-1}{p}\right) = +1 \iff p \equiv 1 \pmod 4.

There is nothing to draw and nothing to count, because Euler’s criterion has already done the work. What is worth noticing is how little the argument uses: it never mentions which numbers are squares, only that raising to the power (p1)/2(p-1)/2 sorts the residues into two halves and that 1-1 lands in one of them for an arithmetic reason.

The same statement through Gauss’s lemma takes slightly longer and is more informative, so it is worth doing. The lemma counts how many of a,2a,,p12aa, 2a, \ldots, \frac{p-1}{2}a land in the top half of the residues modulo pp, and the symbol is minus one to that count. For a=p1a = p - 1, which is 1-1, the multiples are p1,p2,p-1, p-2, \ldots, and the kk-th one is pkp - k. That sits above p/2p/2 exactly when k<p/2k < p/2, which is every kk in the range. So the fold count is (p1)/2(p-1)/2 — all of them — and the symbol is (1)(p1)/2(-1)^{(p-1)/2} again.

Two routes, one answer, and the second one says why the modulus is four: the count runs over half the residues, and whether half of p1p-1 is even is a question about pp modulo four.

The second supplement is a different shape

For a=2a = 2 the multiples are 2,4,6,,p12, 4, 6, \ldots, p-1, and the ones that fold are those exceeding p/2p/2. The kk-th multiple is 2k2k, and 2k>p/22k > p/2 means k>p/4k > p/4. So the number of folds is

p12p4,\frac{p-1}{2} - \left\lfloor \frac{p}{4} \right\rfloor,

and the symbol is minus one to that.

The two supplements, and the residue classes that decide them. A table of odd primes with the Legendre symbols of minus one and two beside the residue of p modulo four and modulo eight.
Fig. 3 The same table over the primes to thirty-one. The last column is the fold count for the multiplier two, computed by walking the multiples rather than from the closed form, and the closed form is asserted against it at every row.
The multiples of 2, modulo 17. Each multiple marked on a strip of residues, with the ones in the top half folded down.
Fig. 4 Gauss’s lemma with the multiplier two, at the modulus seventeen. The eight multiples 2, 4, …, 16 are marked on the strip of residues, and the four that land above the halfway line are folded down; four folds is an even number, so two is a square modulo seventeen.

Evaluate that expression at the four classes of pp modulo eight and the pattern comes out. Take p=17p = 17: (171)/2=8(17-1)/2 = 8 and 17/4=4\lfloor 17/4 \rfloor = 4, so the count is 84=48 - 4 = 4, which is even, and 22 is a square modulo 1717. Take p=19p = 19: (191)/2=9(19-1)/2 = 9 and 19/4=4\lfloor 19/4 \rfloor = 4, so the count is 94=59 - 4 = 5, which is odd, and 22 is not. Running the four cases gives

(2p)=+1    p±1(mod8).\left(\frac{2}{p}\right) = +1 \iff p \equiv \pm 1 \pmod 8.

The eight is not decoration. It arrives because the count involves p/4\lfloor p/4 \rfloor, and the parity of that floor depends on pp modulo eight rather than modulo four — one more halving in the argument buys one more doubling in the modulus. Anyone who has watched the first supplement land on four and expects the second to land there too is making a reasonable guess and is wrong, and the reason is visible in the arithmetic rather than mysterious.

Why a rectangle cannot produce this

The lattice-point proof of the main law is a beautiful thing and it genuinely cannot reach these two cases. Its rectangle has p12\frac{p-1}{2} columns and q12\frac{q-1}{2} rows, and its whole content is that the diagonal of slope q/pq/p misses every lattice point — which is true because pp and qq are distinct primes and so coprime.

Put q=2q = 2 and the rectangle has 212=0.5\frac{2-1}{2} = 0.5 rows, which is not a number of rows. Put q=1q = -1 and there is no rectangle at all. The proof is not merely inconvenient in these cases; the object it counts does not exist.

That is worth dwelling on, because it is a common shape. A counting argument is bounded by what it counts, and when the boundary is reached the honest response is a second argument rather than a stretched first one. Gauss’s lemma survives here precisely because it counts something that still exists — a list of multiples and how many fold — for any multiplier at all, prime or not.

The two supplements together

The multiplicativity of the symbol means the two supplements combine, and the combination is where the modulus eight earns its keep. Since (2p)=(1p)(2p)\left(\frac{-2}{p}\right) = \left(\frac{-1}{p}\right)\left(\frac{2}{p}\right), the class of pp modulo eight decides all three of 1-1, 22 and 2-2 at once.

The two supplements, and the residue classes that decide them. A table of odd primes with the Legendre symbols of minus one and two beside the residue of p modulo four and modulo eight.
Fig. 5 Twenty-one primes, sorted by their residue modulo eight rather than by size. A prime with both symbols positive is 1 modulo 8, and the figure checks that claim over every row it draws rather than printing it.

Reading down the columns, the primes 1mod81 \bmod 8 have both symbols positive, and they are exactly the primes for which 1-1, 22 and 2-2 are all squares. Those are the primes over which the arithmetic is most generous, and they are the ones where several classical theorems become easy at once.

The class 3mod83 \bmod 8 has (1p)=1\left(\frac{-1}{p}\right) = -1 and (2p)=1\left(\frac{2}{p}\right) = -1, so their product (2p)\left(\frac{-2}{p}\right) is +1+1: the two failures cancel. A statement of the form neither of these is a square, so their product is is exactly the kind of thing the symbol makes routine and that direct computation makes tedious.

What each supplement is really about

The first supplement is the condition for the field of residues modulo pp to contain a square root of 1-1 — that is, an element ii with i2=1i^2 = -1. Where it holds, the residues behave like a place where the complex numbers can partly live, and the primes that are sums of two squares are exactly these. The two statements are the same statement: p=a2+b2p = a^2 + b^2 has a solution precisely when 1-1 is a square modulo pp, because a factorisation of pp in the Gaussian integers is what a square root of 1-1 modulo pp produces.

That equivalence is the single most useful consequence in elementary number theory of anything on this ladder, and it is worth stating as a chain: p1(mod4)p \equiv 1 \pmod 4, therefore 1-1 is a square modulo pp, therefore pp is not prime in Z[i]\mathbb{Z}[i], therefore p=a2+b2p = a^2 + b^2. Each arrow is a small theorem and the composite is a classification.

Primes below 40 as sums of two squares. Each prime with its remainder on division by four, and the two squares that add to it where they exist.
Fig. 6 Twenty-nine on the lattice: the circle of radius √29 passes through eight whole-numbered points, which are one representation counted with its four sign changes and its two orders. Twenty-nine is 1 modulo 4, and the first supplement is what guarantees the circle meets the lattice at all.

The middle arrow is the one doing real work. Knowing 1c2-1 \equiv c^2 modulo pp means pp divides c2+1=(c+i)(ci)c^2 + 1 = (c+i)(c-i) in the Gaussian integers while dividing neither factor — so pp is not prime there, and a non-trivial factorisation of pp into Gaussian integers, multiplied by its conjugate, is a2+b2=pa^2 + b^2 = p. Every step of that is elementary and the whole of it fits in a paragraph, which is a good deal for a classification of the primes.

The second supplement is the condition for 2\sqrt{2} to exist among the residues, and its natural home is the ring Z[2]\mathbb{Z}[\sqrt{2}] in the same way. The reason it lands modulo eight rather than modulo four is that Z[2]\mathbb{Z}[\sqrt{2}] has a subtler ramification at the prime two than Z[i]\mathbb{Z}[i] does — but that sentence is a summary of a later subject, and the count above is a complete proof that needs none of it.

A worked case, since the symbols compose

Take the question: is 6-6 a square modulo 3131?

Split it. (631)=(131)(231)(331)\left(\frac{-6}{31}\right) = \left(\frac{-1}{31}\right)\left(\frac{2}{31}\right)\left(\frac{3}{31}\right).

The first supplement: 313(mod4)31 \equiv 3 \pmod 4, so (131)=1\left(\frac{-1}{31}\right) = -1.

The second: 317(mod8)31 \equiv 7 \pmod 8, so (231)=+1\left(\frac{2}{31}\right) = +1.

The main law for (331)\left(\frac{3}{31}\right): both are 3mod43 \bmod 4, so the two symbols are opposite, and (331)=(313)=(13)=1\left(\frac{3}{31}\right) = -\left(\frac{31}{3}\right) = -\left(\frac{1}{3}\right) = -1.

The product is (1)(+1)(1)=+1(-1)(+1)(-1) = +1, so 6-6 is a square modulo 3131. Checking directly: 112=121=3×31+2811^2 = 121 = 3 \times 31 + 28, and 28328 \equiv -3; 142=196=6×31+1014^2 = 196 = 6 \times 31 + 10. Rather than search, note that the answer is +1+1 and trust the machinery — which is the point of having it. For the record, 625(mod31)-6 \equiv 25 \pmod{31} and 25=5225 = 5^2, so 55 is the root, and the computation above never needed to find it.

That last observation is the real content of the whole apparatus. The Legendre symbol answers is there a square root without producing one, and the two questions have wildly different costs. A quantity cheap to compute beside a quantity expensive to compute is the shape of a good deal, and here the cheap quantity is a handful of congruence conditions.

How often each case happens

A congruence condition invites a question about density, and here the answer is as even as it could be. The primes are equidistributed among the classes modulo eight that can contain them — 11, 33, 55 and 77, since the other four classes are even — so each of the four cases takes a quarter of the primes in the long run. Dirichlet’s theorem on primes in arithmetic progressions is what says the classes are non-empty; the equidistribution is a refinement of it.

π(x) below 1000. A staircase counting the primes, with x over the natural logarithm of x beside it.
Fig. 7 The primes to two hundred. Splitting them by residue modulo eight puts a quarter in each of the four odd classes in the long run, and the counts at this size are still noticeably uneven — which is what a limiting statement looks like before the limit.

At two hundred the counts are not yet a quarter each, and the wobble is real rather than an artefact of a small sample: the race between residue classes has its own literature, and one class can lead another for a very long time. What is guaranteed is the limit, and nothing about how quickly it is approached.

The practical consequence is that both supplements are needed about equally often. There is no dominant case to memorise and no shortcut worth having; the four rules — 1mod41 \bmod 4 for 1-1, ±1mod8\pm 1 \bmod 8 for 22 — are the whole of it, and they are short enough to be worth knowing outright.

One asymmetry does survive. The class 1mod81 \bmod 8, where both symbols are positive, is a quarter of the primes and carries more than a quarter of the interest, because it is where several independent conditions hold at once. A prime in that class is a sum of two squares, has 22 as a square, and has 2-2 as one — three separate facts made available by two rules and their product.

Where they came from, and in what order

The chronology is instructive because it runs the opposite way from the logic. Fermat announced the two-square theorem — every prime 11 modulo 44 is a sum of two squares — in 1640, and left no proof. Euler spent seven years on it and finished in 1749, and the argument he found is essentially the chain above run in reverse: he proved the first supplement in order to get the representation.

So the supplement arrived as a lemma for a theorem about squares of integers, half a century before anybody stated a general law of reciprocity. Legendre introduced the symbol in 1785 and gave the supplements their modern shape; Gauss proved the main law in 1796 and put all three together. The tidy modern presentation, in which the main law is stated first and the supplements are appended, inverts the order of discovery entirely.

That inversion is normal and it is worth naming. A subject’s logical spine is assembled after the fact, from results found for unrelated reasons, and the tidy order is a pedagogical artefact rather than a history. Reading it as history produces the impression that Euler was proving a special case of something he had never heard of.

The one place the modern order does better is in explaining the moduli. Presented as Euler presented it, the appearance of 44 is an arithmetic accident of one calculation. Presented as a fold count beside the fold count for 22, the 44 and the 88 sit next to each other and the difference between them is visible: one more division in the argument, one more doubling in the answer.

What the pictures cannot show

The tables are finite and the claims are not. Fourteen primes agreeing with a congruence condition is fourteen instances, and the argument that makes it a theorem is the fold count above, which no drawing displays. The figures check the claim at every row they hold and then stop, which is exactly as far as a table can go.

The fold count is drawn nowhere. The last column of the hero is a number, and the walk that produced it — through (p1)/2(p-1)/2 multiples, testing each against p/2p/2 — happens inside the generator. A picture of that walk for one prime would be the same picture the first rung already draws for a general multiplier, and repeating it here would add a figure and no argument.

And nothing here explains the eight. The count produces it, the table confirms it, and the sentence about Z[2]\mathbb{Z}[\sqrt{2}] gestures at where the explanation lives. A reader who wants to know why two behaves differently from every odd prime has to leave elementary number theory, and the honest thing is to say so rather than to dress the count up as an explanation.

Where the ladder goes next

The supplements complete the toolkit: with the main law, the two of them, and multiplicativity, any Legendre symbol whatever can be evaluated by a chain of reductions that terminates. What they do not do is explain why the law is true, and the rest of this ladder is about that.

The next rung finds the symbol somewhere it has no business being — in the sign of a shuffle, where multiplication by aa is read as a rearrangement of the residues and the parity of its crossings turns out to be the symbol. That is the same bit of information arriving through the theory of permutations rather than through counting lattice points, and the coincidence is not one.

Sideways, the Chinese remainder theorem is what makes the Jacobi symbol behave, and the divisor structure of a number is what the multiplicativity above is a shadow of.

What is worth carrying away

A theorem’s exceptions are usually where its proof ran out rather than where its statement did.

Reciprocity is stated for two odd primes because the rectangle in its proof needs two odd primes to exist. The cases left over are not deeper or shallower than the main law; they are the cases a different count reaches, and the different count is a page long. What makes them interesting is that they land on different moduli — four for 1-1 and eight for 22 — and that difference is not an accident of the proof but a fact about how those two numbers sit inside larger rings.

The habit worth taking is to ask, of any theorem with a hypothesis, what the hypothesis is doing. Here it is holding up a rectangle. Remove it and the rectangle collapses, and the honest response is to find something else to count.

What links here

Computed from the collection, not written here: the essays that point at this one.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Counting-two waysGauss lemmaGaussian integersLegendre symbolModular arithmeticParityPrimesQuadratic reciprocityQuadratic residueSums of two squares