Six Sextillion Grids: The Mathematics of Sudoku

June 20, 20266 min readBen Miller

A Sudoku grid is 81 cells and one rule. It looks like the smallest possible mathematical object — a toy. But hiding inside those 81 cells is some genuinely deep mathematics: a number so large it required clever group theory just to count, a theorem that consumed roughly eight hundred processor-years of supercomputer time, and a direct line to some of the hardest problems in computer science. Here is the tour.

An impossible census

Start with the most basic question: how many valid completed Sudoku grids exist?

In 2005, Bertram Felgenhauer and Frazer Jarvis answered it exactly: 6,670,903,752,021,072,936,960 — about 6.67 sextillion. The count was not done by listing grids; no computer could. It was done by exploiting structure: fixing the top band of the grid into standard forms, counting completions of each form by computer, and multiplying back out through the symmetries.

Numbers that size defeat intuition, so anchor it. Estimates put the number of grains of sand on all the beaches of Earth somewhere around ten quintillion — the Sudoku count is roughly a thousand times larger. If every person alive solved one distinct grid every second, around the clock, exhausting the supply would take on the order of twenty-five thousand years. You will not run out.

Symmetry shrinks the universe

A mathematician's immediate objection: most of those grids are secretly the same puzzle wearing a disguise. Swap all the 3s and 7s, rotate the grid, exchange two rows within a band — you get a "different" grid that solves identically. The digits are just labels; nothing about Sudoku cares that a 3 is a 3.

Count the disguises and they multiply into roughly 1.2 trillion transformations of any single grid: 362,880 ways to relabel the nine digits, times over three million ways to rearrange rows, columns, bands, and reflections. In 2006, Ed Russell and Frazer Jarvis quotiented all of that out and found the number of essentially different Sudoku grids: 5,472,730,538.

Five and a half billion genuinely distinct solution grids — nearly one per human alive. And each of those can be presented through countless different clue sets, which is the layer where puzzles, as opposed to solutions, actually live.

The seventeen-clue theorem

That layer holds the subject's most famous result. A published puzzle is a completed grid with most cells erased, under one sacred promise: exactly one completion must exist. So the natural question — how few clues can you leave and keep the promise?

Puzzle makers had long found 17-clue puzzles; the mathematician Gordon Royle collected tens of thousands of essentially different ones. But no one had ever produced a valid 16-clue puzzle, and no one could prove none existed. The gap between "never seen" and "impossible" sat open for years.

In 2012, Gary McGuire, Bastian Tugemann, and Gilles Civario closed it by brute intelligence: an exhaustive search over the essentially different grids, powered by a purpose-built algorithm for spotting the "unavoidable sets" any clue collection must hit. The computation ran to roughly seven million core-hours — on the order of 800 processor-years — on an Irish supercomputer. The verdict: there is no 16-clue Sudoku. Seventeen is the floor, forever.

Sit with how strange that is. This is a true fact about our universe of grids that no human will ever verify unaided, discovered the way you might survey a continent. Mathematics has an empirical frontier, and Sudoku is on it.

Hard, formally

Why did that take a supercomputer? Because Sudoku belongs to a notorious family. In 2003, Takayuki Yato and Takahiro Seta proved that generalized Sudoku — the same rules on n²×n² grids — is NP-complete, placing it among problems like Boolean satisfiability for which no known algorithm scales gracefully, and for which a fast general solution would resolve the most famous open question in computer science.

Now, the fine print matters: your morning 9×9 is a fixed, finite case, and a modern solver dispatches it in microseconds. NP-completeness describes how the difficulty scales, not how your Tuesday feels. But the classification still explains something real about the human experience. We do not solve by brute-force backtracking — our working memory holds a handful of items, not a search tree. Human solving is constraint propagation under severe memory limits, which is exactly why difficulty for people tracks which deductive techniques a grid demands rather than how many cells are empty. The formal hardness and the felt hardness are cousins, not twins.

The grid is a graph

One more change of glasses. Draw 81 dots, one per cell. Connect two dots whenever their cells share a row, column, or box — every cell ends up with exactly 20 neighbours. Solving Sudoku is now precisely this: color the dots with nine colors so no connected dots match, where the clues are dots pre-colored for you.

This is graph coloring, one of the central problems of discrete mathematics — and the same abstract problem underneath scheduling exams so no student sits two at once, assigning radio frequencies so neighbouring transmitters don't interfere, and allocating processor registers inside the compiler that built the app you are reading this on. Your puzzle habit is applied graph theory. The reverse is also true, and it is why puzzle skills feel strangely transferable: you are rehearsing a structure the world keeps reusing.

Uniqueness, the quiet miracle

Notice that every result above leans on the same load-bearing promise: one solution, exactly. That promise is what converts arithmetic into logic. Every deduction you make — "this cell must be a 5" — is valid only because a well-made puzzle guarantees there is a single consistent world to deduce about. Constructing a puzzle is subtractive sculpture: remove clues one by one, re-verifying after each cut that the promise still holds, stopping at the edge where one more erasure would let a second solution in. We have written before about how we ensure every puzzle has a unique solution; the mathematics here is why we bother. Fairness, in puzzles, is a theorem — checked, per grid, before it ever reaches you.

What the numbers are for

None of this is required knowledge. The grid works the same whether or not you know it is one of 6.67 sextillion siblings, floored at seventeen clues, NP-complete in general, and a graph coloring in disguise.

But the numbers are good for one thing: perspective. Eighty-one cells and a one-sentence rule generate a space of possibilities thousands of times larger than the sand of every beach on Earth — enough that in a lifetime of daily solving, you will never meet the same grid twice, and neither will anyone else. That ratio — smallest rules, vastest consequences — is the actual signature of mathematics, and it is sitting in your morning routine, disguised as a pastime.

← Back to Blog