If you know The Hitchhiker's Guide to The Galaxy, then you also know the answer to Life, the Universe and Everything. But how did Douglas Adams come up with that number?

On a Sunday in the spring of 1981 Douglas Adams was typing a letter. "Dear Ken," he began. "Your book was really very useful to me . . ." The thank-you letter from Adams to Australian writer Ken Welsh, author of Hitch-hiker's Guide to Europe, continues, "[One evening in 1971] I got frantically depressed in Innsbruck . . . When the stars came out I thought that someone ought to write a Hitchhiker's Guide to the Galaxy because it looked a lot more attractive out there than it did around me."

Keeping the idea safe, Adams hitched to Istanbul before returning to England for three years as a Cambridge student, where he became an underachieving comedy writer and performer. Eventually, though, his eureka moment in an alpine meadow would spark a remarkable phenomenon. And one original idea in The Hitchhiker's Guide to The Galaxy, first broadcast as a radio comedy in 1978, has developed a life quite unlike any other joke, before or since.

The plot for the six episodes leapt very much wherever Adams wanted to go on the day, but led to a pivotal gag that went like this; a giant computer called Deep Thought, having spent exactly 7.5m years pondering on Life, the Universe and Everything finally and solemnly announces that the Ultimate Answer is . . . "Forty two".

Adams – who died, aged 49, 10 years ago this May – had launched the world's greatest universal joke. Often you hear it as a simple namecheck, a gently conclusive "Douglas Adams", said whenever a spontaneous 42 is seen as a seat number, a restaurant table, or a homework answer. Others post lists of favourite 42s, snap "42" photos, or enjoy throwing a 42nd birthday party (Pink Floyd performed on stage with Adams for his special day). There are the influential friends as well – both Google's HQ and Cern's Large Hadron Collider have office complexes named for the number.

The joke has been running for more than three decades and the momentum seems as strong, or perhaps even stronger, than ever. Famous and notable instances are lovingly prized; the world's first modern book was Gutenberg's 42-line bible and the US national anthem is about an historic 42ft star-spangled banner. Another celebrated use is 42 Wallaby Way – the address on the diving mask in Pixar's Finding Nemo. Playing an elaborate joke on a richer-than-Croesus friend, author Ian Fleming made it the age of Bond villain Auric Goldfinger.

For many followers the question of "Why 42?" has been an enjoyable part of the enigma. Adams kept his magic in the tin, never revealing (other than to his friend Stephen Fry, who claims he'll take the secret to his grave) the full story. Several theories have circulated and a few of these Adams selected for deflation; the idea that he had been paying tribute to Lewis Carroll, who also used the number; that he had been joking in a base 13 number system; or that it was an obscure reference to the traditional number of rulers of Tibet. Adams was ever meticulous in his choice of words and numbers, and it's safe to say it wasn't a random pick.

As the book's title suggests, Adams, like most authors, was not afraid to borrow, and there are revealing similarities between Welsh's Hitch-hiker's Guide to Europe and The Hitchhiker's Guide to the Galaxy. One of these provides perhaps the most intriguing explanation for "Why 42?". As you may remember Adams had Deep Thought perform a little expectation management and say: "You're really not going to like it" before revealing the Ultimate Answer.

Curiously, Hitch-hiker's Guide to Europe had told of visitors to the UK searching for family roots finding "the answer a little disappointing" – after travelling around the world in search of "the solution to the most puzzling question of all". A coincidence, perhaps . . . but this coincidence is on page 42.

A cheery "Best wishes, Douglas Adams" signed off the letter, which duly arrived in Spain, the country Welsh had chosen to adopt as home, and where he lives still. He tells me he's not hitch-hiking quite so much these days.