MathomalyA field guide to patterns, proofs and open questions

ExplorationsRed or blue for every number, with no triple all one colour

Colour Without a Triple

Known as The Boolean Pythagorean triples problem

Exhaustively checkedPythagorean triplesgraph colouringsatisfiabilitycurious Seen in Mathomaly No. 06 at 5:48

Colour each of the numbers 1, 2, 3 and onward red or blue so that no triple a² + b² = c² has all three numbers the same colour, as in 3² + 4² = 5². A colouring exists all the way to 7,824. In 2016 a computer showed that none exists for 1 to 7,825.

Interactive laboratory

Current view: Colour the numbers

A board of numbers you colour red or blue, with the clash made visible the moment a triple is all one colour.

Colour each number red or blue so that no triple a² + b² = c² has all three numbers the same colour.

The key fact. Some red and blue colouring of 1 to 7,824 has no triple all one colour. No colouring of 1 to 7,825 does. Heule, Kullmann and Marek proved it by computer in 2016; this page cites that result and does not recompute it.

Showing 1 to 60.

No triple is all one colour. Your colouring reaches 0.
The same data as a table
NumberColourAll-one-colour triples
a red number
drawn with a circle in its corner as well as the colour
a blue number
drawn with a square in its corner as well as the colour
a clash
a triple whose three numbers are one colour, outlined in black

Each tile is a number. Tap it to colour it red, tap again for blue, again to clear it; a circle in the corner means red and a square means blue, so the colour is not the only cue. A triple is three numbers a, b, c with a² + b² = c². If all three are one colour, the three tiles are outlined in black and the triple is written out under the board; undo or recolour to clear it. Your reach is the largest number up to which every number is coloured and no triple is all one colour. Tiles with a dashed edge were coloured by the machine.

Nothing is coloured yet. Colour 1, 2 and 3, then keep going; the first place you can slip is 5.

Reach
0
Numbers coloured
0
Triples that clash
0

Things to try

Things to try with this figure
  • Not done yet: Colour 1 to 30 with no triple all one colour

    Colour each number red or blue. When a move makes a triple, undo it and try the other colour, or go back further.

  • Not done yet: Colour 1 to 50 with no triple all one colour

    The numbers that sit in many triples need care. Look ahead before you colour them.

  • Not done yet: Colour 1 to 100 with no triple all one colour

    By hand this takes planning, not luck. The machine can help you check an idea but it does not count here.

  • Not done yet: Go as far as you can by hand

    Keep colouring past 100. Your best is remembered in this browser.

  • triples
  • What breaks it. Two colours are enough to colour the numbers 1, 2, 3, … so that no triple is all one colour. Try: The range reaches 7,825. At that point, by the 2016 computer proof, every red and blue colouring has a triple all one colour.

  • Colour 3 and 4 red. What colour must 5 be, and what does that do to 12 and 13?

    Hint

    If 5 were red, 3, 4, 5 would be all red. And 5² + 12² = 13², so with 5 blue, 12 and 13 cannot both be blue.

  • Colour the numbers any way you like up to 20, then press Let the machine finish. Does it always go on?

    Hint

    Not always. If your early colours leave nothing that works for some later number, the machine stops at the edge and says so.

  • In the scatter view, tap a large dot and then follow the line that appears. What are the small dots on it?

    Hint

    They are multiples of the large one: doubling 3, 4, 5 gives 6, 8, 10, and so on out along the ray.

How this page is laid out

Colour the next number

The next number is 1. You can also tap any number on the board.

The machine

It keeps your colours and extends them as far as a simple search can, up to 2,000.

Cases worth seeing

What is going on

Each explanation begins with a worked example and follows the same operation through intuition, formal statements and proofs. Later sections distinguish what is established from questions that remain open, so you can follow the level of detail useful to you.

Worked by handColour 3 and 4 red: the first two forced consequences, written out.
  1. 3 and 4 red3² + 4² = 5²5 blueif 5 were red as well, the triple 3, 4, 5 would be all one colour, so 5 has to be blue
  2. 5 blue5² + 12² = 13²12 and 13 not both bluewith 5 blue, making 12 and 13 blue too would put the triple 5, 12, 13 all in one colour

The game above opens on a blank board, but this is its first real decision. Colouring 3 and 4 red leaves the number 5 no choice, and 5 then bears on 12 and 13.

The second step does not say which of 12 and 13 is red. It says only that they are not both blue. A colouring is a long chain of these half-decisions, and 7,824 numbers is how long a chain can go before one of them has no way out.

01

What you are seeing

A plain description of the picture

A is three positive whole numbers , , with . The smallest is , because . Then comes , which is doubled, and , and so on.

9162534sides 3, 4, 53² = 94² = 165² = 259 + 16 = 25Squaring a side means building a square on it. The 9 and the 16 cells together make exactly the 25.

The game asks you to colour the whole numbers red or blue, one at a time. The rule is that no triple may have all three of its numbers the same colour. Colour 3, 4 and 5 red and you have broken it. Mathomaly then outlines the three tiles, writes the triple as and lets you undo.

Your reach is how far the colouring goes with every number coloured and no triple spoiled. The challenges ask for 30, then 50, then 100. A button asks a small search of the page's own to finish your colouring for you, keeping every colour you chose, and to say how far it got and why it stopped.

The other views are about the triples themselves: a plot of every triple up to a , a family tree that grows every from 3, 4, 5, a generator that makes a triple from two numbers, and a long colouring found by a solver.

02

Why it starts to make sense

Intuition, before any algebra

Each triple is a small constraint on three numbers: they may not all be red, and they may not all be blue. Early on the constraints barely touch. The numbers 1 and 2 are in no triple at all, so any colour will do for them. Triples then start to link numbers together, and every number you colour removes a choice from the others.

The chain in the worked example is the pattern. Colour 3 and 4 red and 5 is forced to be blue. Then 5, 12, 13 is a triple, so 12 and 13 cannot both be blue. If you had coloured 12 blue earlier, 13 is now forced red, and 13 sits in other triples of its own. Every forced colour reaches further numbers, and a colouring that is fine at 100 can have a corner of its own making at 300, where one number is forced both red and blue by two different triples.

You might expect the board to jam quickly, because the triples are numerous: about nine thousand of them fit inside 7,824. They are not as dense as they sound. A triple needs a sum of squares to land exactly on a square, so most numbers are in only a few, and the numbers 1 and 2 and many others are in none. The surprise is that the board survives for so long.

Pictures help. The scatter view plots each triple as a dot. The dots fall on straight rays through the corner, because doubling or tripling a triple stays a triple, and on two curved families that come from the simplest formulas. The family tree shows that every , one with no common , is built from 3, 4, 5 by three steps. Euclid's formula generates primitive triples from pairs of whole numbers.

03

The key idea

What was known, and what the computer added

Two facts about the colouring game are on the page, and they are different kinds of fact.

A colouring exists up to 7,824. We show a colouring found offline by a . Your browser checks it against every triple in its range whenever you open the view, and passing this finite, exact check proves that colourings exist that far.

No colouring exists at 7,825. In 2016 Marijn Heule, Oliver Kullmann and Victor Marek proved that every red and blue colouring of 1 to 7,825 has a triple that is all one colour. Their is by computer. The problem has about colourings, far too many to look at one by one, so the solver prunes huge families of them together and records every step in a proof that another program can check. The proof was nearly 200 terabytes when it was first checked. It is cited here and never recomputed.

Together the two facts say that 7,824 is the exact of what two colours can do.

The three other views belong to the numbers behind the game. A triple is primitive when its three numbers share no common greater than 1, like 3, 4, 5 and unlike 6, 8, 10. Every triple is a primitive one multiplied by a whole number, so are the ones that matter. Euclid's formula makes all of them from two numbers, and the Berggren tree arranges them in a family in which each triple has exactly three children.

04

Formal statement

Precisely what is being claimed, and by whom

Triple. A is of positive with and . A colouring of is a map to two colours, and a triple is monochromatic when . Every integer carries one colour wherever it occurs, so a number such as 5 has the same colour in and in . Non- such as count too.

Proved by computer (Heule, Kullmann and Marek, 2016). Every colouring of has a monochromatic triple, and some colouring of has none.

What this page establishes itself. It checks a stored colouring of a long range against every triple in that range, and it counts triples in exact arithmetic. It does not run or check the that no colouring of exists. That half is cited to the authors, and the sources list says plainly that it has not been independently checked here.

What the search on the page is not. The button that lets the machine finish uses a small backtracking search with restarts. It is nowhere near the machinery that settled 7,825. When it stops it reports which of three things happened: it proved your colouring cannot be extended, it ran out of its allowance, or it reached the the page tries. Only the first is a statement about the colouring. The second is a floor, not a limit.

05

What is proved on this page

The short arguments, written out

Euclid's formula. For ,

So is a triple. It is primitive exactly when and share no and have opposite . If and are both odd, every side is even. If they share a factor , every side has the factor . The generator names which of these happened. That every arises this way, from exactly one such pair, is the standard parametrisation. We test the parametrisation for every primitive triple with hypotenuse at most 1,000, and we do not reprove it here.

The family tree. Take a with Euclid pair . The three children have pairs , and . Each is again with opposite . Now take any such pair other than . Exactly one of three cases holds: , or , or . (The value cannot happen, since and are coprime with .) In the first case is the first child of ; in the second it is the second child of ; in the third it is the third child of . Each parent has a strictly smaller first number. So going up from any primitive triple ends, after finitely many steps and by exactly one route, at the pair , which is . Every primitive triple therefore appears exactly once in the tree.

The first forced colours. If 3 and 4 are both red, then forces 5 blue. With 5 blue, means 12 and 13 cannot both be blue. The worked example above is this argument, and a unit test recomputes each step with the colour check the game uses.

Our finite checks. We compute the ledger's triple counts with two separate enumerations and they agree. We check the stored colouring against every triple in its range. These checks do not mean that we recompute the for 7,825.

06

Limits and frontier

Where this page stops being able to help

The search is small. In our tests, the search colours 2,000 numbers from an empty board within its step allowance, but exhausts a larger allowance when trying 3,000. The stored colouring reaches much further, and the for 7,825 used a stronger solver and a larger computation. The paper reports an allocation of 800 cores on the Stampede supercomputer for about two days and a proof of almost 200 terabytes; a certificate of 68 gigabytes lets other computers regenerate and check it. We quote those figures from the paper and have not repeated its computation.

Your colouring may be the problem. A colouring that looks fine at 100 may have no extension at all. The machine tells you when it has proved that, and it names the number at which your colours ran out. A different early choice, such as recolouring 3 and 4, may go on much further. Nothing says every colouring of a short range can be extended to a long one, and the machine's answer view shows only that one colouring exists to its .

Three colours and more. We use two colours throughout this exploration. The same question with more colours is a different problem, and nothing on this page says anything about it.

What would be new. A shorter of the 7,825 result, or a human-readable reason that no colouring reaches 7,825, would be new. At the moment the only known proof is the computer's.

Read this next to Colouring the Plane. There the colours go on points of the plane and a computer found the finite obstruction that raised the lower bound. Here the colours go on whole numbers and a computer found the exact .

What is actually established

Every statement on this page, with its status, its exact scope, and the date that status was last checked.

Proved

Every colouring of the numbers 1 to 7,825 with two colours has some triple a² + b² = c² with all three numbers the same colour.

Scope
Heule, Kullmann and Marek, 2016, a proof by computer using a satisfiability solver with cube-and-conquer. Cited, not recomputed: the page does not run the proof or check its certificate. The statement counts every triple of positive whole numbers with a < b < c, primitive or not.
Why
The same authors also found that some colouring of 1 to 7,824 avoids every monochrome triple, so 7,825 is the exact edge. The proof is a verified computer proof of about 200 terabytes in the form it was first checked, and a much smaller certificate that lets other computers regenerate and check it. The page takes both figures from the paper’s own account and does not run either.
Status checked
Exhaustively checked

The colouring on the machine’s answer view gives every number from 1 to 7,824 one of two colours, and none of the 9,465 triples in that range is all one colour.

Scope
The colouring stored with the page, over exactly 1 to 7,824. It shows independently of the cited paper that a colouring of that range exists, which is a finite fact. It says nothing about 7,825 or about every colouring: the impossibility at 7,825 is the cited claim above.
Computation (exact)
The colouring was found offline by a SAT solver (scripts/pythagorean-certificate.py). The unit tests and the page itself check it against every triple a² + b² = c² in its range, found by two separate enumerations, in exact integer arithmetic. Algorithm pythagorean-triples-1.
Status checked
Proved

If 3 and 4 are both red, then 5 must be blue, and then 12 and 13 cannot both be blue.

Scope
A direct consequence of the triples 3² + 4² = 5² and 5² + 12² = 13², for any two-colouring of numbers that include 3, 4, 5, 12 and 13.
Why
A colouring is only allowed if no triple is all one colour. 3, 4, 5 is a triple, so with 3 and 4 red, 5 cannot be red. Then 5, 12, 13 is a triple, so with 5 blue, 12 and 13 cannot both be blue. The tests check both steps against the kernel’s colour check.
Status checked
Exhaustively checked

There are 6 triples with every number at most 20, 9,465 with every number at most 7,824 and 9,472 with every number at most 7,825; of those, 3, 1,245 and 1,247 are primitive.

Scope
Triples of positive whole numbers a < b < c with a² + b² = c² and c at most the stated limit, primitive and non-primitive counted separately.
Computation (exact)
Counted in exact integer arithmetic by Euclid’s formula with all multiples, and checked against a second enumeration that tries every pair a, c with an integer square root, over every limit tested up to 500 and at the three limits quoted. Algorithm pythagorean-triples-1.
Status checked
Proved

For whole numbers m > n > 0, the numbers m² − n², 2mn and m² + n² always form a triple. It is primitive exactly when m and n share no factor and have opposite parity, and every primitive triple arises from exactly one such pair.

Scope
Classical. The page checks the identity and the primitivity test for every m up to 60, and the exact-once statement for every primitive triple up to 1,000, and writes the identity out in layer 5.
Why
The identity is (m² − n²)² + (2mn)² = (m² + n²)², which expands to equal sides. The converse and the exactly-once statement are the standard parametrisation of primitive triples, which the page states and tests but does not reprove in full.
Status checked
Proved

Every primitive Pythagorean triple appears exactly once in the tree that starts at 3, 4, 5 and gives each triple the three children made by the three fixed sums on the page.

Scope
The Berggren (also called Barning) tree. The argument is a descent on Euclid’s pair (m, n) and is written out in layer 5; the tests also check the tree against the list of all primitive triples to a bound that every branch has passed.
Why
In terms of (m, n) the three children of a triple are (2m − n, m), (2m + n, m) and (m + 2n, n). Given any pair (M, N) other than (2, 1), exactly one of the three cases M < 2N, 2N < M < 3N, M > 3N applies, and it gives a pair with smaller numbers. Repeating ends at (2, 1), which is 3, 4, 5. So every primitive triple has exactly one parent and one route up to the root.
Status checked
Observed in this run

The page’s own search, started from nothing, finds a colouring of every range it was tested on up to 2,000 within 100,000 steps, and it does not reach 3,000 within 300,000 steps.

Scope
The simple search in this page, a backtracking search with restarts and unit propagation. It says nothing about whether colourings exist beyond that, which the 2016 result and the machine’s answer view settle by other means.
Computation (approximate)
Tested in the unit suite from an empty colouring, with a step being one number coloured and propagated, in exact integer arithmetic. The result depends on the order the search tries colours and is not a property of the problem. Algorithm pythagorean-triples-1.
Status checked

Sources

Review notes show which bibliographic details Mathomaly has checked and which remain unresolved. Checking a publication record does not independently verify its proof.

I’ve checked each citation below against the publication itself, unless it says otherwise. That checks the reference, not the proof.

  1. Marijn J. H. Heule, Oliver Kullmann, Victor W. Marek, Solving and Verifying the Boolean Pythagorean Triples Problem via Cube-and-Conquer, SAT 2016, 2016. Link

    The result that every red and blue colouring of 1 to 7,825 has a triple a² + b² = c² all in one colour, while some colouring of 1 to 7,824 has none. A computer proof by cube-and-conquer, reported with an 800-core, about two-day solve and a proof of almost 200 terabytes. The page cites it and does not recompute the 7,825 half.

    Bibliographic review:

    AI-assisted bibliographic audit. Evidence type: source text.

    Downloaded the PDF and read its title, the three authors and the abstract: the Boolean Pythagorean triples problem, the Cube-and-Conquer solution, the 800 cores and about 2 days, the DRAT proof of almost 200 terabytes and the 68-gigabyte compressed certificate. The threshold 7,825 is read on the authors’ page below; it was not located in the body of the paper. Did not check the proof.

  2. Marijn J. H. Heule, Everything’s Bigger in Texas: results, proofs and tools for the Boolean Pythagorean triples problem, The authors’ project page, University of Texas at Austin, 2016. Link

    The authors’ own plain statement: however 1 to 7,825 is coloured red and blue there is a monochromatic Pythagorean triple, while 1 to 7,824 can be coloured with none. Cited with the paper for the same result.

    Bibliographic review:

    AI-assisted bibliographic audit. Evidence type: author record.

    Read the page text: it names the SAT 2016 paper and its three authors, states both parts (a monochromatic triple in every colouring of 1 to 7,825, and a colouring of 1 to 7,824 with none), gives 2^7825 as about 3.63 times 10^2355 and describes the 200-terabyte proof. Did not run or inspect the linked proof files.

(connected by how they work)