# Finally! A solution to 42 – the Answer to the Ultimate Question of Life, The Universe, and Everything

Mathematicians have finally cracked the sum-of-three-cubes problem for the geek-friendly number 42. The puzzle, set more than half a century ago in 1954, challenges you to solve the equation x3 + y3 + z3 = k, where x, y, z are integers and k is an integer from 1 to 100. Some values of k are impossible to solve, and the …

1. I think all this proves is that some mice inserted the number 42 into Douglas Adams' head all those years ago. Now I am wondering when the program will stop running.

1. I guess the next "sigh" will be when we hear "so long and thanks for all the fish".

2. #### Whenever I read stories like this...

... it makes me feel rather thick.

—-> This. For them.

3. I just leave this one here: 10^3 + 9^3 = 12^3. Well, almost.

The one with the unit in the pocket.

1. With those numbers you have the solution in hand for 1.

1. Classic Parker Square

2. 1729 = 12^3+1^3 = 10^3+9^3, making 1729 the first "taxicab number."

https://en.wikipedia.org/wiki/Taxicab_number

From the above :

The name is derived from a conversation in about 1919 involving mathematicians G. H. Hardy and Srinivasa Ramanujan. As told by Hardy:

“I remember once going to see him [Ramanujan] when he was lying ill at Putney. I had ridden in taxi-cab No. 1729, and remarked that the number seemed to be rather a dull one, and that I hoped it was not an unfavourable omen. 'No,' he replied, 'it is a very interesting number; it is the smallest number expressible as the sum of two [positive] cubes in two different ways.'"

Somebody (don't remember who) once said of Ramanujan that it seemed as if every integer was a personal friend of his. So it's not too surprising that Ramanujan noticed this right away.

Unfortunately, Ramanujan died the next year, so the "favourable omen" bit didn't pan out.

4. #### Y^2?

Am I being daft, but why does the proof show y^2 and not y^3?

1. #### Re: Y^2?

Just a typo, the value shown on the right really is y^3.

2. #### Re: Y^2?

Just a typo. It's fixed.

C.

1. #### Re: Y^2?

There’s no why in typo. #angleofobservation

5. #### Disturbing

There don't seem to be any mice round here. Should I be worried?

P.S. a coat is a poor substitute for a towel!

1. #### Re: Disturbing

Autumn is closing in, the mice, currently largely outside will come in and make themselves known to you. I must bait and reset my traps. I only caught three last Autumn.

Of course white mice are almost all housed with ad libitum food and water and a constant warm climate in labs all over the world. They can also sometimes be found in pet shops.

Personally despite having spent my working life working on mice I would prefer rats as pets. Rats have more smarts and personality. They can also be trained to be less likely to piss and poo and you.

It might have something to do with pet rats and lab rats being much less inbred than most of the mice. Because we have a strongly established genetics for mice and not for rats. Which means inbred lines. Outbred mouse mothers will collect the faeces of her and her offspring and push them up into the cage bars wth the sawdust keeping the nest clean. Inbred mothers do not.

1. #### Re: Disturbing

> Outbred mouse mothers will collect the faeces of her and her offspring and push them up into the cage bars wth the sawdust keeping the nest clean. Inbred mothers do not.

Things I learned from El Reg's commentariat, part 239.

2. #### Re: Disturbing

Pet store rats don't live very long the ones we got reached two years at most and got tumors.

1. #### Re: Disturbing

Try contacting your local rat club: far more reliable and a great source of information on keeping the pesky varmints.

1. #### Re: Disturbing

SQUEAK

1. #### Re: Disturbing

SQUEAK?

3. #### Re: Disturbing

"Personally despite having spent my working life working on mice..."

So you still haven't cottoned on that they're working on you, eh?

I'll get my towel --->>>

4. #### Re: Disturbing

Chipmunks over here :-(

5. #### Re: Disturbing

It's not as if you can only get Weil's disease from wild rats though, or is it?

I thought all rats have a constantly leaking bladder so that they leave a trail of piss behind them?

Mighty spring loaded metal rat traps for the lot of em - let them wear them as hats

2. #### Re: Disturbing

> a coat is a poor substitute for a towel!

I request and demand that our El Reg overlords provide us with a towel icon!

1. #### Re: Disturbing

"I request and demand that our El Reg overlords provide us with a towel icon!"

Agreed, but I've been pushing for a Pterry icon for the past couple of years, to no avail. Your demands fall on deaf ears I'm afraid.

1. #### Re: Disturbing

I upvoted you as I'm in total agreement, but what I would like to do is downvote the stick-in-the-mud devs who are ignoring our totally reasonable request.

2. #### Re: Disturbing

A black fedora could meet that need and provide greater flexibility for other purposes.

1. #### Re: Disturbing

You hearing this, Vultures? It's about time!

3. #### Re: Disturbing

Would a towelling bathrobe suffice as a compromise?

1. #### Re: Disturbing

> Would a towelling bathrobe suffice as a compromise?

Towelling inferno?

4. #### a coat is a poor substitute for a towel!

Indeed, but if you squint enough, that could be a dressing gown.

6. “The computation on each PC runs in the background so the owner can still use their PC for its usual tasks,” Sutherland told The Register.

Yet another pointless waste of energy keeping the CPU at high clock and the drives spinning just like the distributed Mersenne prime software. And it encourages people to leave their PCs runnng where they previously might have turned them off. These mathematical curiosities are of no theoretical or practical value even within the field of mathematics let alone outside it.

If you must run something in the background, do something useful like Folding@home. Or turn the computer off, got for a walk and do flora & fauna surveys for the RSPB or whoever. Who knows, you might discover a new species of insect or plant. Wouldn't that be more satisfying than some pointless string of digits?

1. Where to start?

Just one point: the techniques used in such HPC tasks have a tendency to be useful for other tasks. Say, for the computer algebra system you are using.

OK, another one: the proudly non-applied field of number theory turned (many decades later) out to be the guts of error-correcting codes and cryptography. Useful for computer-y stuff, you know?

Of course the alternatives like protein folding (and tons others) are exciting as well.

1. I'm all for pure research and the unexpected spin-offs it generates.

But mathematicians themselves say that these sorts of brute force searches are pointless. Explain to me how knowing the answer for 42 or finding the largest Mersenne prime advances any field in mathematics. It's all stamp collecting. Real mathematics is done by mathematicians not computers.

1. Real mathematics is done by mathematicians not computers.

Mathematicians have generally taken advantage of computers, including back in the old days when computers wer humans.

2. > ...these sorts of brute force searches are pointless.

Number crunching is not mathematics, sure. But brute force computations are useful, for example, for ...

Finding solutions for Diophantine equations when you don't have stronger theorems, possibly helping you to find theorems (yes, you must prove them).

Verifying or falsifying conjectures. In discrete mathematics (e.g., number theory, coding theory, combinatorics, ...) this is done all the time.

Numerically solving problems that are outright impossible to do by hand. Nonlinear differential equations are a good example (think solitons).

It is routine to use computers to observe properies and make conjectures. A certain Gauss did this all the time.

Not every mathematician works this way, but a lot of them do. So...

> Real mathematics is done by mathematicians not computers.

...implies that dozens of mathematicians I happen to know are not actually mathematicians. I refuse to to believe that.

1. I'd say that if a mathematician uses a computer (or a calculator for that matter) that the person is still doing the math, the machine is just doing the calculation.

A computer doing math would, to me, be like one writing their own software.

3. As an individual result it may not really help all that much, but I'd posit that at the very least:

a) an algorithm was developed to help search the solution space - perhaps a nice undergrad project, possibly even a masters element

b) existing theorem's/hypotheses are present that help filter out bits of the solution space as a waste of search time - having this result will help validate them or even extend them, even if it can't prove a general case

c) it may perhaps inspire others to come up with a general purpose proof that these things exist, much like Andrew Wiles' proof of Fermat's theorem - I suspect this is more in line with the end game.

An example of an instance where the equation holds true isn't proof that the equation is true for all values - the two problems are approached in a very different way, and both pose challenges in implementation, and (for some) are fun to play with.

Let the maths-bods have some fun, and that includes the ones donating CPU to the project.

4. #### re:Real mathematics is done by mathematicians not computers.

That's just hopelessly out of date. Many proofs are computer-aided now. Figuring out how to use computers to find proofs that cannot ever be done unaided is a part of modern mathematics.

Quite old now, but Fermat's last theorem is a good example.

5. Four colour theorem.

It's about using a tool appropriate to the job to do the boring parts, rather than having the computer hypothesise new theories (which they can't do anyway).

And Mersenne primes are incredibly important.

Sorry, but that's just a staggering amount of ignorance you're showing.

And I'm a mathematician, and a computer science guy.

1. "And Mersenne primes are incredibly important."

I'd be interested to know why they're so important compared to say a non-trivial prime number (one not determinable in any programmatic way), or perhaps a proof that prime numbers have no discrete or algorithmic distribution.

1. Mersenne Primes are forming the basis of some ECC curves because of their special properties, as well as random number generators, not to mention being an integral part of some post-quantum cryptography candidates (e.g. Mersenne-756839).

Every time you say to a mathematician "Well what's the point of that?", I guarantee you that it's *already* in use somewhere for some purpose that will end up in something you use every day and rely on.

1. This post has been deleted by its author

2. I withdrew my earlier post because it hadn't been made clear that "Mersenne number" (n = 2^p - 1 where p is prime) and "Mersenne prime" (n = 2^p - 1 where p is prime) are actually the same thing (2^p - 1 being prime -> p is also prime). That said, I'll believe their practicality when I see them in action.

2. Let's really think about this. I don't mind if people want to donate cycles to finding this answer. But why do we care about it? I really like lots of abstract math problems, but they didn't find and execute a new algorithm that can solve these things; they brute forced a bunch of options and found one. If we should need to solve this problem for some reason in the future, and I'm willing to assume we've found one even though I haven't a clue what that would be, does this program give us a new, faster, or organized way of solving for it? From what I've seen, it does not, and we'd have to put more resources into a brute force search. So let's not give it the kind of credit that you've implied. The examples you provide gave us new algorithms, and they turned out to be useful later on. All we got from this are three big numbers.

Computing resources can be quite cheap in cases like these. If that's the way people choose to use them, then that's fine. But let's not give this more credit than it deserves.

2. Yet another pointless waste of energy keeping the CPU at high clock

Not all BOINC projects are a waste of energy.

That said, I used to be a supporter back when a PC's clockspeed was fixed, but once my house server, which runs 24/7, had its old hardware replaced with a variable clock speed dual Athlon box and I'd had to listen to the poor thing howling continuously at maxed-out clock speed and full-throttle fans, BOINC got the chop and has never been reinstalled.

Bottom line: I'm happy to donate unused cycles to worthwhile projects, but these were not unused cycles: they would not have existed if BOINC hadn't stomped the PC's pedal to the metal and held it there.

1. I think subsidised (by someone else) cycles would be more appropriate.

2. #### PC's pedal to the metal

You can tune BOINC to not hammer the CPU quite as hard. I run most of my machines with a 75% CPU cap; They don't run as hot; but still do useful work.

1. #### Re: PC's pedal to the metal

It's still going to consume resources that it needn't if it were switched off or put into deep sleep until an external event woke it up to do useful work.

Despite all the protests to the contrary in this thread, finding huge Mersenne primes and sum-of-cubes triples using existing algorithms doesn't achieve anything for mathematics, HPC or cryptography.

If someone designs/discovers a new, better algorithm that then might be useful elsewhere I agree.

But that doesn't justify consuming power to run an existing algorithm - that achieves diddley-squat, other than smugness if it happens to be one of 'your' computers that finds a larger/harder solution.

And quite often its academic BOFHs who install this nonsense on all the computers under their control and it's the students or the taxpayers who end up paying for the juice to power & cool it & the extra spinning-rust wear-and-tear, let alone the environmental damage.

3. RSPB = Royal Society for the Prevention of Bigness?

1. #### Nah

It has to be the Register Society for the Promotion of BOFHness. (Meeting currently in progress over at "Who Me".)

7. #### Nice.

Great work. That would've made Douglas very happy. But it's a travesty that the proof is so simple.

Hmmm... that's got me thinking... I wonder if anyone's ever tried solving

a^n + b^n = c^n

for n greater than 2? Maybe I'll have a go after the cricket.

1. #### Re: Nice.

Fix a and b, then c = (a^n + b^n)^(1/n).

Wait, you meant integer solutions? OK, take any n>=3. Then 0^n + 1^n = 1^n.

1. #### Re: Nice.

Fermat's Last Theorem required a and b (and therefore c) to be positive integers greater than zero, and n to be greater than two.

I realised some years ago that the general theorem which states that the following has no solution:

a^n + b^n = c^n

can be simplified to the following true algorithm:

(a-1)^n + a^n < (a+1)^n

for all n greater than two.

Which I would assume (I'm no mathematician) is easier to prove in a mathematical sense than the original theorem. Which would then also prove Fermat.

(I like to think this is the simple proof Fermat alluded to in his infamous margin, but I guess we'll never know.)

1. #### Re: Nice.

(a-1)^n + a^n < (a+1)^n is not correct for fixed n and small enough a. For example, a=7 and n=3 gives (a-1)^n + a^n = 6^3+7^3 = 559 and (a+1)^n = 8^3 =512. As 559 > 512, we have a counter example.

1. #### Re: Nice.

You see, this is why I'm not a mathematician. :)

2. #### Re: Nice.

It's highly doubtful that Fermat actually had a proof. First, he never wrote about it again for the thirty or so years he lived after the famous scribble(despite posing specific exponent versions as challenges to other mathematicians of the day); second, the actual proof was over a hundred pages and relied on recently invented techniques(which would mean a proof based solely on early/mid 1600s math would probably be well over a thousand pages - a magnitude that would warrant language stronger than "this margin is too narrow to contain").

1. #### Re: Nice.

Obligatory XKCD https://xkcd.com/1381/

3. #### Re: Nice.

required a and b (and therefore c) to be positive integers greater than zero

A good thing, given the drastic shortage of positive integers less than or equal to zero.

2. #### Re: Nice.

Andrew Wiles solved Fermat's Last Theorem in 1994.

1. #### Re: Nice.

I know. Noticed the troll icon?

2. #### Re: Nice.

Actually, Wiles' theorem proves Fermat's old conjecture. But I'm afraid Wiles has zero chance of his name being associated with the theorem in popular media...

3. #### Re: Nice.

But not properly. Fermat couldn't quite fit his solution in the border of his notebook. Wiles used half the Amazon for his.

1. #### Re: Nice.

> Fermat couldn't quite fit his solution in the border of his notebook.

Nobody I ever met believes that Fermat really had a proof.

Diophantine equations with high exponents tend to be very hard to attack.

1. #### Re: Nice.

> Nobody I ever met believes that Fermat really had a proof.

I'm not much of a believer in afterlife, but I get a chuckle out of the idea that Fermat's corner of hell, for whatever reasons, is everybody recognizing him, looking at his proof in the margin, and going "you forgot a minus at the beginning there, mate".

8. Whatever floats your boat - it's increasing our collective knowledge that counts.

You never know when one of these interesting unknowns will turn up as a showstopper in a real world problem.

1. And thats the real reason we do pure research.

1. Let me add another important reason. It's fun.

1. This has got to be the most important reason.

2. It's fun.

Some people think pissing in phone booths is fun. Doesn't give them the right to do it.

I think drinking to excess is sometimes fun. Not sure I can use that as a justification for doing it all the time though. ;-)

2. Firm believer in supporting pure research in the hard sciences & mathematics.

Not a believer in supporting vanity stamp collecting projects that degrade our environment.

I'd like my near-future descendants to have some dry land to live on.

9. #### Anyone got any idea of how many calculations were done to discover this?

geek mind needs to know now!

10. #### Marvin

What's the probability this i'd turn up and read this, oh dear just dreary old math philosophy.

11. Scientific Progress Goes 'BOINC'

12. you are all wrong

if you watch the origional series you will see that 42 was an error

the real answer to life, the universe and everything is really 56

1. Aah, no.

In Life, The universe and Everything, it is confirmed that 42 is the answer, however it is impossible for the Question and the Answer to both be known in the same Universe as they'll cancel each other out.

2. If you're referring to Arthur's use of teh scrabble tiles to divine the question (what do you get if you multiply six by nine) then I think you mean 54.

But the programme that ended with Arthur's result was corrupted by the Golgafrincham B Ark, which is why he produced the wrong question.

</pedant>

Fairly awesome that when I looked at this story, there were 42 comments.

Of course, I have now just stuffed that up.

No, there are 42 + x comments now.

14. #### OK the soultion is known

OK the answer is 42.Does anyone know the Ultimate question of Life, the universe and everything? Or do we have to wait for the Vogons to show up?

1. #### Re: OK the soultion is known

"What do you get if you multiply six by nine?"

1. #### Re: OK the soultion is known

in base 13, it works out.

1. #### Re: OK the soultion is known

Nicely done, colour me impressed!

1. #### Re: OK the soultion is known

You do realise that now the universe will vanish and be replaced by something even more bizarre and inexplicable.

1. #### Re: OK the soultion is known

"You do realise that now the universe will vanish and be replaced by something even more bizarre and inexplicable."

15. #### Checked it

On Fedora Linux

\$ bc

bc 1.07.1

Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.

This is free software with ABSOLUTELY NO WARRANTY.

For details type `warranty'.

x=-80538738812075974

y=80435758145817515

z=12602123297335631

x^3+y^3+z^3

42

16. But does he know where is towel is?

1. and is he really a frood?

17. #### Silly question...

Does the proof say that x != -y or -z etc?

just an example : if x = -y then z=k so all numbers have a solution or set of solutions.

1. #### Re: Silly question...

> if x = -y then z=k

Nope. if x = -y then z=cube_root(k), which is not an integer.

2. #### Re: Silly question...

That only works for perfect cubes like 8, 27, or 64 (which are respectively -1, 0, and 1 modulo 9).

18. #### 1337

x^3+y^3+z^3=317

19. #### Towels

Are the things in the picture supposed to be towels? They look more like prayer shawls.

I'm sure DA had something more fluffy, without tassels, in mind.

## POST COMMENT House rules

Not a member of The Register? Create a new account here.