← All articles
mathnumbersgeometryhistorySeptember 17, 20263 min read

Which Triangles Have Whole Number Sides? Solutions Nobody Runs Out Of

By the BrainSnail editorial team. How these articles are written and checked, and how to tell us when one is wrong.

Three whole numbers where the squares of two add to the square of the third give a right angled triangle with no awkward measurements. There are infinitely many, they can all be generated, and people were using them four thousand years ago.

What they are

A triple is three positive whole numbers where the sum of the squares of the two smaller equals the square of the largest, which by the theorem relating the sides of a right angled triangle means those three numbers are the sides of such a triangle. The smallest is three, four and five, which anyone can check. Multiplying any triple by a whole number gives another, so six, eight and ten works, and triples whose members share no common factor are called primitive, with all the others being multiples of a primitive one. There are infinitely many primitive triples, which is not obvious and follows from a construction that generates them all.

How to generate them

A formula produces every primitive triple and nothing else:

  • Take two whole numbers, the larger first, sharing no common factor and not both odd
  • The difference of their squares gives one side
  • Twice their product gives another
  • The sum of their squares gives the longest side
  • Two and one give three, four and five
  • Three and two give five, twelve and thirteen, and the construction never repeats a triple

The tablet that shows they were known

A Babylonian clay tablet catalogued as Plimpton 322, dating to roughly 1800 before the common era, contains a table of numbers that includes one column of triples, listing fifteen rows of them including some with very large values that could not have been found by trial. Its purpose is argued about, with proposals that it is a teacher's list of problems with convenient answers, a table for a trigonometric purpose, or a demonstration of a generating method, and the disagreement is substantial and ongoing. What is not disputed is that the relationship was known and could be generated systematically more than a millennium before the Greek mathematician whose name is attached to the theorem, which is a useful corrective to accounts that begin with Greece.

The ones people actually use

Three, four and five has practical uses that are still current. Setting out a right angle on the ground without instruments is done by measuring three units along one line, four along another and adjusting until the diagonal is five, which is exact rather than approximate and which builders, surveyors and gardeners use constantly. A rope knotted at twelve equal intervals forms the triangle directly when pegged out, and such a device has been proposed as the method behind ancient right angles though the evidence for it is weaker than its popularity suggests. Larger triples serve where longer runs are needed, with six, eight and ten and with five, twelve and thirteen both in common use. The technique works because the converse of the theorem holds, so a triangle with those sides must contain a right angle.

The question they raised

The natural extension of the question turned out to be one of the hardest problems in mathematics. Asking whether the same works for cubes or higher powers, meaning whether whole numbers exist where two cubes sum to a cube, produced Fermat's famous claim in about 1637 that no such numbers exist for any power above two, written in a margin with the remark that the proof was too long to fit. No proof was found for three hundred and fifty years, despite enormous effort that generated whole fields of mathematics along the way. Andrew Wiles proved it in 1994 using machinery from a completely different area, in a proof running to over a hundred pages that almost nobody can follow. The original marginal claim is generally assumed to have been mistaken.

The takeaway

Three whole numbers where two squares sum to the third give a right angled triangle, and a two-number construction generates every primitive triple exactly once. A Babylonian tablet from around 1800 before the common era lists triples too large to have been found by trial. Asking the same question for cubes and higher powers took three hundred and fifty years to answer.

Practise this

Questions from Integers and Number Theory

Reading about something is not the same as being able to recall it. These are real questions from the Integers and Number Theory unit in our Math track, answers and explanations included. The unit has 120 in total across 21 steps.

  • Match the pairsLevel 3

    1. Match each number to how many factors it has.

    Answer: 9 = 3 factors; 12 = 6 factors; 7 = 2 factors

    9 has 3 factors (1, 3, 9), 12 has 6 factors, and 7 has 2 factors.

  • Choose all that applyLevel 3

    2. Select all numbers that are less than -3.

    • -5correct
    • -8correct
    • -1
    • 0

    -5 and -8 are farther left than -3, while -1 and 0 are greater than -3.

  • Fact or fibLevel 2

    3. The square of a negative number is negative.

    Answer: False

    A negative times a negative is positive, so (-3) x (-3) = 9, which is positive.