Number

Every triple, on one circle

Draw a line of rational slope through a single point of a circle. Wherever it comes out is a rational point, and clearing the denominators turns it into a Pythagorean triple — so every triple there is comes from one line through one point.

Worth reading first: Two squares, four triangles, and no algebra · A sphere is a plane plus one point.

Three, four, five. Five, twelve, thirteen. Eight, fifteen, seventeen. Twenty, twenty-one, twenty-nine. The list of whole-number right triangles goes on forever and has no obvious pattern, and it can be produced in its entirety by a single geometric construction.

Rational points on the unit circle. Lines of rational slope through the left-hand point of a circle, each meeting it again at a rational point.
Fig. 1 Lines of rational slope through the left-hand point of the unit circle. Each one meets the circle a second time at a point with rational coordinates, and clearing denominators turns that point into a whole-number right triangle. The generator computes each triple from its slope and checks that it satisfies the theorem.

Dividing a2+b2=c2a^2 + b^2 = c^2 by c2c^2 gives (a/c)2+(b/c)2=1(a/c)^2 + (b/c)^2 = 1, so every triple is a point with rational coordinates on the unit circle, and conversely every rational point on the circle scales up to a triple. The two questions are the same question.

The circle of radius √169 on the integer lattice. A circle drawn on the whole-number grid, with the lattice points it passes through marked.
Fig. 2 The same identification at a larger radius, where the count stops being obvious. The circle of radius 1313 on the integer lattice: twelve whole-numbered points on it, which are (5,12)(5,12) and (12,5)(12,5) with their sign changes. A triple with hypotenuse cc is exactly a lattice point on the circle of radius cc, so the question which right triangles have whole-number sides has already become the question which circles pass through lattice points, and the second is a question about 169169 rather than about triangles.

The move from the first question to the second is worth naming, because it is the whole method. A search over triples of whole numbers is a search over an infinite three-dimensional set with a constraint. Dividing by cc turns it into a search over a curve, and a curve is one-dimensional; then the projection below turns the curve into a line, and a search over a line of rational numbers is no search at all, because the rational numbers can simply be listed. Two reductions and the problem stops being a problem.

Why a rational line hits a rational point

Fix the point (−1,0)(-1, 0), which is on the circle, and take the line through it with slope t=m/kt = m/k.

Substituting y=t(x+1)y = t(x+1) into x2+y2=1x^2 + y^2 = 1 gives a quadratic in xx with rational coefficients, and one of its roots is already known: x=−1x = -1, the point the line was drawn through. A quadratic with rational coefficients and one rational root has a rational other root, because the two roots sum to a rational number.

That is the whole argument, and it is worth pausing on because it explains why the trick works for conics and stops working immediately afterwards. A line meets a conic in two points; knowing one of them rational forces the other. A line meets a cubic in three points, and knowing one rational root of a cubic tells nothing about the other two — which is why the same method fails for x3+y3=1x^3 + y^3 = 1, and why Fermat’s last theorem is not settled in a paragraph.

Carrying the algebra out gives

x=k2−m2k2+m2,y=2mkk2+m2,x = \frac{k^2 - m^2}{k^2 + m^2}, \qquad y = \frac{2mk}{k^2 + m^2},

and clearing denominators produces the triple (k2−m2, 2mk, k2+m2)(k^2 - m^2,\ 2mk,\ k^2 + m^2) — Euclid’s parametrisation, which appears in Book X of the Elements with no circle in sight.

Every triple, exactly once

The construction produces triples. That it produces all of them, and each primitive one exactly once, needs the correspondence to run both ways.

Given a triple, divide by cc to land on the circle, draw the line from (−1,0)(-1,0) to that point, and read off the slope. The slope is rational because both coordinates are, so every rational point comes from some tt — and different points give different slopes, because a line through (−1,0)(-1, 0) meets the circle only once more.

Rational points on the unit circle. Lines of rational slope through the left-hand point of a circle, each meeting it again at a rational point.
Fig. 3 A different set of slopes, giving 3,4,53,4,5 then 21,20,2921,20,29 then 55,48,7355,48,73 and three more. Every rational slope between zero and one gives a distinct triple, and every primitive triple arises from exactly one slope in lowest terms with kk and mm of opposite parity.

So the rational points on the circle are in bijection with the rational numbers, and the triples are the rational numbers in different clothing. That is a complete answer to a question that looks as though it should have a list rather than a formula.

The primitivity condition needs a word. The formula with k=3k = 3, m=1m = 1 gives (8,6,10)(8, 6, 10), which is (4,3,5)(4, 3, 5) doubled. Requiring gcd⁡(k,m)=1\gcd(k, m) = 1 and kk, mm of opposite parity gives exactly the primitive triples, each once. When both are odd the formula produces twice a primitive triple, which is why the parity condition is there and not an aesthetic preference.

The same projection, twice

The construction — project from a point of a circle onto a line, and pull rational points back — is stereographic projection in one dimension lower.

Stereographic projection, one dimension down. A circle resting on a line: rays from the top of the circle match its points with points of the line, and only the top has no partner.
Fig. 4 The projection this essay uses, in the form it is usually met: a circle projected from one of its own points onto a line. Every point of the circle except the one projected from lands somewhere on the line, and every point of the line comes from exactly one point of the circle.

That is not an analogy, it is the same map. The circle minus the point (−1,0)(-1, 0) corresponds bijectively with the line of slopes, exactly as the sphere minus its north pole corresponds with the plane; and the missing point is the slope “infinity”, the vertical line, which meets the circle only at (−1,0)(-1, 0) itself.

Recognising it as a projection says what generalises. The same argument parametrises the rational points on any conic that has one rational point to project from — and the caveat is not decorative. The circle x2+y2=3x^2 + y^2 = 3 has no rational points at all, so there is nothing to project from and the method never starts. Whether a conic has a rational point is itself a substantial question, answered by the Hasse–Minkowski theorem: it has one exactly when it has one modulo every prime and over the reals, which reduces an infinite search to finitely many congruence checks.

Reading the triples off the lattice

The circle is one way in. The lattice is another, and the two describe the same objects differently.

The circle of radius √25 on the integer lattice. A circle drawn on the whole-number grid, with the lattice points it passes through marked.
Fig. 5 The circle of radius 55 on the integer lattice, passing through (3,4)(3, 4) and its seven reflections. A Pythagorean triple with hypotenuse cc is a lattice point on the circle of radius cc, so counting lattice points on circles counts triples too.

Jacobi’s formula counts the lattice points on the circle of radius n\sqrt{n}, and applying it at n=c2n = c^2 counts the triples with hypotenuse cc. A hypotenuse admits a primitive triple exactly when it has a prime factor ≡1(mod4)\equiv 1 \pmod 4, and admits several when it has several — 65=5×1365 = 5 \times 13 is the hypotenuse of two primitive triples, (63,16,65)(63, 16, 65) and (33,56,65)(33, 56, 65), one for each factor.

So the two-squares theory and the triples theory are the same theory. That 55, 1313, 1717 and 2929 are the hypotenuses that appear early is the same fact as their being the primes that are sums of two squares, and the primes ≡3(mod4)\equiv 3 \pmod 4 never appear as a primitive hypotenuse at all.

The bridge between the two is the Gaussian integers, where a triple is a squaring. If k+mik + mi is a Gaussian integer, then (k+mi)2=(k2−m2)+2mki(k + mi)^2 = (k^2 - m^2) + 2mki, whose real and imaginary parts are the two legs, and whose norm is (k2+m2)2(k^2 + m^2)^2 — the hypotenuse squared. So generating a triple is squaring a complex number with whole-number parts, and the parametrisation that this essay derived from a line through a circle is the map z↦z2z \mapsto z^2 restricted to the lattice. Two routes, one formula, and neither of them mentions the other’s objects.

Triples can be multiplied together

The Gaussian-integer remark above says a triple is a square. It says something stronger that is worth drawing out, because it gives the set of triples an operation and explains a count the essay quoted without justifying.

The rational points on the unit circle are complex numbers of size one, and complex numbers of size one multiply. So two triples compose into a third, by multiplying the corresponding points — which in coordinates is the angle-addition formula, and in the projected picture is the tangent-addition formula on the slopes.

Do it to (3,4,5)(3,4,5) and itself. The point is 35+45i\tfrac{3}{5} + \tfrac{4}{5}i, and squaring it multiplies out to real part 3⋅3−4⋅4=−73 \cdot 3 - 4 \cdot 4 = -7 over twenty-five and imaginary part 3⋅4+4⋅3=243 \cdot 4 + 4 \cdot 3 = 24 over twenty-five. Clearing the denominator gives the legs 77 and 2424, and indeed 49+576=62549 + 576 = 625, which is twenty-five squared. The triple (7,24,25)(7, 24, 25) is (3,4,5)(3,4,5) composed with itself.

Now the count. The essay claimed above that 6565 carries two primitive triples because it factors as 5×135 \times 13, and the composition says exactly why. Multiply the 55-point by the 1313-point: the real part is 3⋅5−4⋅12=−333 \cdot 5 - 4 \cdot 12 = -33 and the imaginary part is 3⋅12+4⋅5=563 \cdot 12 + 4 \cdot 5 = 56, and 1089+3136=42251089 + 3136 = 4225, which is sixty-five squared. That is (33,56,65)(33, 56, 65).

Multiply instead by the conjugate of the 1313-point — the same triple with its second leg negated, which is the reflection of that point across the axis. The real part is 3⋅5+4⋅12=633 \cdot 5 + 4 \cdot 12 = 63 and the imaginary part is 4⋅5−3⋅12=−164 \cdot 5 - 3 \cdot 12 = -16, and 3969+256=42253969 + 256 = 4225 again. That is (63,16,65)(63, 16, 65), the essay’s other triple.

So the two triples with hypotenuse sixty-five are the two ways of combining a five with a thirteen, and there is no third because there is no third choice: each prime factor contributes its point or that point’s mirror image, and the two options for one factor with the two for the other give four combinations that pair off into two triples under overall reflection. A hypotenuse with three such prime factors carries four primitive triples, with four factors eight, and the doubling at each step is a choice of conjugate.

That is the whole content of the counting formula the essay quoted from the lattice, arrived at without a lattice. A prime that is not a sum of two squares contributes no point to multiply by, so it can never appear in a primitive hypotenuse at all — which was stated above as an observation and is now a consequence of there being nothing to compose with.

The projection has therefore done more than list the triples. It has given them a group, and every arithmetic fact about which hypotenuses occur how often is a fact about that group’s structure.

What the picture cannot show

The figure draws six lines and a circle, and the set it describes is infinite and unbounded in every direction. Slopes near zero give triples with one leg vastly longer than the other; slopes near one give nearly isosceles triples, which are rare and interesting — (3,4,5)(3,4,5), (20,21,29)(20,21,29), (119,120,169)(119,120,169) — and are themselves governed by a Pell equation and appear at exponentially spaced intervals.

More importantly, the picture cannot show that the parametrisation is complete. It shows six triples arriving from six slopes; the theorem is that no triple arrives from anywhere else, and completeness is the whole content. The argument for it is the two-way correspondence in the section above, and no drawing carries a bijection — a bijection is a claim about two infinite sets, and a figure is a claim about a handful of points.

There is a third thing the drawing hides, which is the difference between the rationals and the reals. The circle drawn on the page looks continuous and the rational points are dense on it, so nothing in the picture distinguishes a rational point from any other. The whole subject lives in that invisible distinction: the circle has continuum-many points and countably many rational ones, and the difference between those two sizes is exactly what makes the parametrisation worth having.

The tree above the parametrisation

The parametrisation lists the triples, and it does not organise them. There is a structure that does, and it was found much later.

Every primitive triple has exactly three children, obtained by multiplying the column vector (a,b,c)(a, b, c) by three fixed integer matrices, and every primitive triple has exactly one parent — so the primitive triples form a ternary tree rooted at (3,4,5)(3, 4, 5). Barning found it in 1963 and Hall in 1970; it is remarkable that a set studied for three thousand years turned out to have an unnoticed tree structure in the twentieth century.

The tree is the parametrisation seen through kk and mm, where the three matrices act on the pair (k,m)(k, m) by simple linear maps, and it is a close relative of the mediant tree — both are generated by two-by-two integer matrices of determinant one acting on pairs, both produce every object of their kind exactly once, and both are unrecognisable as trees from the objects they enumerate.

What the tree adds is a notion of distance the parametrisation does not have. Two triples with similar-looking sides may be far apart in the tree, and two that look unrelated may be parent and child: (3,4,5)(3,4,5)'s three children are (5,12,13)(5,12,13), (21,20,29)(21,20,29) and (15,8,17)(15,8,17), which is not an ordering anybody would guess from the numbers. Enumerating a set and organising it are different achievements, and the parametrisation only does the first.

The same distinction shows up whenever a set has more than one natural description. The Stern–Brocot tree and the Farey sequence hold identical fractions and answer different questions; the divisor list and the divisor lattice hold identical divisors and only one of them shows the arithmetic. The lesson each time is that the arrangement is not a presentational choice — it is where the information is.

The triangles that are nearly isosceles

One family in the list deserves following, because it turns a question about triples into a question about a completely different equation.

A right triangle with legs differing by one — (3,4,5)(3,4,5), (20,21,29)(20,21,29), (119,120,169)(119,120,169), (696,697,985)(696,697,985) — is as close to isosceles as a whole-number right triangle can be, and it cannot be isosceles, because that would make 2\sqrt2 rational. Setting b=a+1b = a + 1 in a2+b2=c2a^2 + b^2 = c^2 and rearranging gives (2a+1)2−2c2=−1(2a+1)^2 - 2c^2 = -1, which is Pell’s equation for 2\sqrt2.

Whole-number points on x² − 2y² = 1. The branch of the hyperbola x² − 2y² = 1 in the first quadrant, with the whole-number points on it marked and labelled, and the lattice drawn faintly behind.
Fig. 6 The hyperbola these triples live on, drawn with the sign the other way. Its whole-number points in the first quadrant are (3,2)(3,2), then (17,12)(17,12), then (99,70)(99,70) — every solution with yy up to 7070 found by trying every yy rather than by trusting the pattern. The triples come from the companion equation, whose solutions (7,5)(7,5), (41,29)(41,29), (239,169)(239,169) interleave with these along the same continued fraction: 7/57/5 gives (3,4,5)(3,4,5), 41/2941/29 gives (20,21,29)(20,21,29), 239/169239/169 gives (119,120,169)(119,120,169). Two hyperbolas, one expansion, and the convergents alternating between them.

So the near-isosceles triples are the continued-fraction convergents of 2\sqrt2 in disguise, they grow by a factor of about 5.85.8 each time, and there are infinitely many of them. Three separate constructions in this collection — the peeling of a rectangle, the descent that proves 2\sqrt2 irrational, and this parametrisation of triangles — turn out to produce the same sequence of numbers, because all three are about how badly 2\sqrt2 can be approximated by fractions.

The area of a right triangle

Fermat’s one surviving complete proof is about these triangles, and its conclusion is negative.

No Pythagorean triangle has a square area. Equivalently, there are no whole numbers with a2+b2=c2a^2 + b^2 = c^2 and 12ab\tfrac12 ab a perfect square. Fermat proved it by descent — assume such a triangle exists, construct a strictly smaller one, and note that a decreasing sequence of positive whole numbers cannot continue — and it is the only proof he wrote out in full.

The result matters more than it looks. It implies the case n=4n = 4 of Fermat’s last theorem immediately, which is why that case was settled three centuries before the rest. And it is the first theorem in what became the theory of congruent numbers: which whole numbers are the area of some right triangle with rational sides. One and two and three are not; five, six and seven are. The question is equivalent to a statement about rational points on the elliptic curve y2=x3−n2xy^2 = x^3 - n^2 x, and a complete answer depends on the Birch–Swinnerton-Dyer conjecture, which is unproved.

So the same triangles that yield to a paragraph of coordinate geometry when the question is “which ones exist” become one of the seven Millennium Problems when the question is “which areas occur”. Nothing in either figure distinguishes the two questions, and that is the honest summary of what a picture of this subject can and cannot do.

What the ancients knew

Plimpton 322, a Babylonian tablet from about 1800 BC, lists fifteen rows of numbers that are, on the standard reading, Pythagorean triples — including (12709,13500,18541)(12709, 13500, 18541), which nobody stumbles on by trial. Whatever generated it was systematic, and the reconstruction that fits the data best is close to the kk, mm parametrisation, with the entries generated from ratios of regular numbers.

That is a thousand years before Pythagoras and fifteen hundred before Euclid wrote the parametrisation down. What the tablet does not contain is any statement of the theorem or any argument, which is the recurring difficulty with pre-Greek mathematics: the outputs demonstrate a method and the method was never written.

Euclid’s own presentation, in Book X, is a lemma about numbers rather than a result about triangles, and it makes no reference to right angles at all. The circle in this essay is entirely modern — it is Diophantus’ method of chords, formalised in the nineteenth century — and its value is that it explains why the parametrisation is complete, which Euclid’s version demonstrates without illuminating.

The tablet has one more thing worth saying about it. Its rows are ordered, and what they are ordered by is the ratio of the short leg to the long one, running smoothly from about 0.990.99 down to about 0.40.4 — which is to say, by angle. Whether that makes it a trigonometric table, as one recent reading argues, or a set of exercises in reciprocal pairs, as the more conservative reading has it, the ordering is deliberate and it is geometric. Somebody was looking at these numbers as shapes, and doing so a millennium and a half before anybody wrote down a proof about them.

Where the ladder goes next

This is the third rung on the Pythagoras ladder. The dissection proof established the theorem by rearranging area; this rung takes the theorem as given and asks which whole numbers satisfy it, which is a different question that happens to have a complete answer.

The next question is the obvious one and has no such answer: an+bn=cna^n + b^n = c^n for n≥3n \ge 3. The chord construction fails immediately, because a cubic curve does not hand over its third intersection, and what replaces it — the arithmetic of points on elliptic curves — is the machinery Wiles eventually used. The gap between a conic and a cubic is the gap between a paragraph and three hundred years.

Closer to hand, the same lattice carries the question of which numbers are sums of two squares, and the same projection carries the sphere onto the plane.

What links here

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

Reads more easily once this is understood

Essays that name this one as worth reading first.

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.

BijectionConicDescentHypotenuseParametrisationPrimitive tripleProjectionPythagorean triplesRational pointsRight triangleStereographic projectionUnit circle