Museum of Numbers
Exhibit No. 42

The answer that finally found its sum

In a famous comedy, a giant computer spends seven and a half million years working out the answer to life, the universe and everything. The answer is 42. It was a joke.

Then, decades later, real mathematicians borrowed a planet-sized computer of their own - and discovered that 42 had been hiding a genuine secret all along.

Mathematical Curiosities · Computing Limits · 7 min read
Vintage ink engraving of an enormous ancient computer glowing in a vast hall, a crowd of expectant figures before it, the number 42 appearing on its screen

Seven and a half million years

In 1978, BBC radio listeners heard a strange new comedy called The Hitchhiker's Guide to the Galaxy, written by Douglas Adams. In it, a race of hyper-intelligent beings builds a supercomputer called Deep Thought and asks it one question: what is the answer to life, the universe and everything?

Deep Thought thinks about it for seven and a half million years. Finally, in front of an eager crowd, it gives its answer:

Forty-two.

The crowd is not pleased. Deep Thought calmly points out the problem: the answer is fine. It is just that nobody ever really knew what the question was.

Ink engraving of a grand chamber, robed figures faces falling in disbelief before a glowing computer showing the number 42, a comic mood

The punchline of seven and a half million years

So why 42?

For years, fans built elaborate theories - that 42 was a secret code in binary, or a hidden message in base 13, or something to do with Tibetan monks.

In 1993, Douglas Adams answered them online:

"It was a joke. It had to be a number, an ordinary, smallish number, and I chose that one."

He said that he had simply sat at his desk, stared into the garden, and thought: 42 will do.

Ink vignette of a man at a desk by a garden window with a typewriter, the number 42 on the page

A puzzle about cubes

Now leave the galaxy, and come back to Earth - to a puzzle mathematicians have been poking at since the 1950s.

A cube is a number multiplied by itself three times. 2 × 2 × 2 = 8. 3 × 3 × 3 = 27. The puzzle asks: can you make a given number by adding up exactly three cubes? You are allowed to use negative numbers, too - and a negative number cubed stays negative, so some cubes can cancel others out.

Some numbers are easy. For example:

3 = 1³ + 1³ + 1³

Some numbers are impossible. If a number leaves a remainder of 4 or 5 when you divide it by 9 - like 4, 5, 13 or 14 - no three cubes can ever make it. For everything else, mathematicians suspect there is always an answer. But finding it can be astonishingly hard.

By 2019, every possible number up to 100 had been solved - except two.

33

unsolved

42

unsolved

Playful ink illustration of stacked cube building blocks showing 1, 8, 27, 64, some negative cubes on a balance scale, and a board of numbers 1 to 100 with 33 and 42 glowing unsolved

Almost every number ticked off. Almost.

Inspired by a video

In early 2019, Andrew Booker, a mathematician at the University of Bristol, watched a YouTube video about the puzzle and the unsolved numbers.

He came up with a cleverer way to search - and after three weeks of calculations on a university supercomputer, he cracked 33. The solution used three numbers, each 16 digits long.

That left just one number under 100 unsolved. And of all the numbers in the world, it was 42.

Ink illustration of a mathematician in a university office, laptop open with a video playing, whiteboard full of cube equations, 33 crossed off and 42 circled

33 crossed off. 42 circled. One number left.

Enjoying this story?

NumberMuseum tells the stories behind remarkable numbers - the people, the accidents, and the surprises hiding inside them. Get the next one delivered to your inbox.

One new story a week, at most.

At most one email a week.

Sweeping ink engraving of the Earth at night seen from space, dotted with glowing lights connected by threads into a vast web, with a faint ghostly ancient computer in the clouds

Hundreds of thousands of home computers, linked into one

A planet-sized computer

Booker soon realised that 42 needed far more computing power than his university had. So he teamed up with Andrew Sutherland of MIT, an expert in enormous calculations.

Together they turned to Charity Engine - a project that borrows the spare, idle computing power of hundreds of thousands of ordinary home computers around the world, linking them into one giant worldwide machine. The University of Bristol described it as a planetary computing platform reminiscent of Deep Thought.

The machines searched. And searched. The calculation took more than a million hours of computing time. And then, in September 2019, the answer arrived.

Three cubes make 42

Here it is - the answer to the puzzle of 42:

42 = (−80538738812075974)³ + 80435758145817515³ + 12602123297335631³

Every one of those three numbers is 17 digits long. When you cube them, the results are colossal: the two biggest cubes are each 51 digits long.

Two of the cubes are gigantic and almost cancel each other out - one enormous negative, one enormous positive. What is left over, plus the third cube, lands exactly on 42. No more, no less.

Adams chose 42 because it was ordinary. It turned out to be one of the hardest ordinary numbers of all.

Dramatic ink illustration of cosmic balance scales, a colossal dark block on one side, two colossal bright blocks on the other, the tiny difference glowing as 42

Two colossal forces, almost balanced - the difference is 42

Ink vignette of a raised fist in celebration beside a glowing computer screen, a small number 3 glowing in the background

Andrew Sutherland said that finding it was "definitely a fist-pump moment."

And just a few weeks later, the same team found a brand-new way to write 3 as a sum of three cubes - answering a question that the mathematician Louis Mordell had asked back in 1953.

A taxi ride away

If this all sounds familiar, it is because this museum has met cubes before. 1729, the famous taxi number, is the smallest number you can make by adding two positive cubes in two different ways:

1729 = 1³ + 12³ = 9³ + 10³

1729 needed just a few small numbers and a moment of genius in a hospital room. 42 needed three 17-digit numbers and a computer the size of a planet. Same idea. Very different journeys.

Playful ink illustration: on one side a small vintage taxi marked 1729 carrying four little cubes, on the other a gigantic spaceship carrying three colossal cubes heading for 42

Same idea. Very different journeys.

The question, not the answer

There is a lovely twist here. In the story, Deep Thought's answer is useless because nobody knew the question. In real life, it was the other way round. Mathematicians knew the question perfectly well - can 42 be made from three cubes? - and it took decades, and a planet's worth of computers, to find the answer.

And the hunt is not over. A handful of numbers below 1,000 are still waiting for their three cubes. The smallest of them is 114.

Some questions are easy to ask and fiendishly hard to answer. That is exactly what makes them worth asking.

Ink illustration of a long corridor of numbered doors, the door marked 42 open with light spilling out, further doors still shut with one labelled 114

The door marked 42 stands open. Others remain shut.

Warm ink illustration of a well-worn paperback book with the number 42 glowing on its pages, the Earth wrapped in connected lights in the background

A number chosen on a whim. A planet needed to confirm it.

Why we still remember it

42 is probably the most famous "random" number in the world. People write it on T-shirts, hide it in computer programs, and slip it into films and books as a wink to anyone who knows.

Partly because The Hitchhiker's Guide to the Galaxy is so funny. Partly because it pokes fun at our hunger for one big answer to everything.

And now, partly because a number chosen on a whim turned out to be the last unsolved piece of a real mathematical puzzle - solved by a computer that really did span the planet.

42 in a nutshell

  • 1.

    In The Hitchhiker's Guide to the Galaxy (first broadcast in 1978), the computer Deep Thought spends seven and a half million years calculating the answer to life, the universe and everything: 42.

  • 2.

    Douglas Adams said it was simply a joke: an ordinary, smallish number.

  • 3.

    Mathematicians had long been trying to write every number up to 100 as a sum of three cubes. By 2019, only 33 and 42 were left.

  • 4.

    Andrew Booker solved 33 in 2019.

  • 5.

    In September 2019, Booker and Andrew Sutherland solved 42, using the spare power of hundreds of thousands of home computers:

  • 42 = (−80538738812075974)³ + 80435758145817515³ + 12602123297335631³

  • 6.

    It is a distant cousin of 1729, the smallest number made from two cubes in two ways.

Final recap ink illustration combining Deep Thought, a desk by a garden window, a board with 42 ticked off, the Earth in a web of glowing computers, and a small taxi marked 1729

It began as a punchline.

42 was the answer all along - it just took a planet to find the sum.

Other exhibits in the cabinet

Powered by DollarPageClub