In his book *Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work*, G. H. Hardy tells this famous story:

He could remember the idiosyncracies of numbers in an almost uncanny way. It was Littlewood who said every positive integer was one of Ramanujan’s personal friends. I remember once going to see him 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 cubes in two different ways.”

Namely,

But there’s more to this story than meets the eye.

First, it’s funny how this story becomes more dramatic with each retelling. In the foreword to Hardy’s book *A Mathematician’s Apology*, his friend C. P. Snow tells it thus:

Hardy used to visit him, as he lay dying in hospital at Putney. It was on one of those visits that there happened the incident of the taxicab number. Hardy had gone out to Putney by taxi, as usual his chosen method of conveyance. He went into the room where Ramanujan was lying. Hardy, always inept about introducing a conversation, said, probably without a greeting, and certainly as his first remark: “I thought the number of my taxicab was 1729. It seemed to me rather a dull number.” To which Ramanujan replied: “No, Hardy! No, Hardy! It is a very interesting number. It is the smallest number expressible as the sum of two cubes in two different ways.”

Here Hardy becomes “inept” and makes his comment “probably without a greeting, and certainly as his first remark”. Perhaps the ribbing of a friend who knew Hardy’s ways?

I think I’ve seen later versions where Hardy “burst into the room”.

But it’s common for legends to be embroidered with the passage of time. Here’s something more interesting. In Ono and Trebat-Leder’s paper The 1729 K3 surface, they write:

While this anecdote might give one the impression that Ramanujan came up with this amazing property of 1729 on the spot, he actually had written it down before even coming to England.

In fact they point out that Ramanujan wrote it down more than once!

Before he went to England, Ramanujan mainly published by posting puzzles to the questions section of the *Journal of the Indian Mathematical Society*. In 1913, in Question 441, he challenged the reader to prove a formula expressing a specific sort of perfect cube as a sum of three perfect cubes. If you keep simplifying this formula to see why it works, you eventually get

In *Ramanujan’s Notebooks, Part III*, Bruce Berndt explains that Ramanujan developed a method for finding solutions of Euler’s diophantine equation

in his “second notebook”. This is one of three notebooks Ramanujan left behind after his death—and the results in this one were written down before he first went to England. In Item 20(iii) he describes his method and lists many example solutions, the simplest being

In 1915 Ramanujan posed another puzzle about writing a sixth power as a sum of three cubes, Question 661. And he posed a puzzle about writing $1$ as a sum of three cubes, Question 681.

Finally, four or five years later, Ramanujan *revisited* the equation in his so-called *Lost Notebook*. This was actually a pile of 138 loose unnumbered pages written by Ramanujan in the last two years of his life, 1919 and 1920. George Andrews found them in a box in Trinity College, Cambridge much later, in 1976.

Now the pages have been numbered, published and intensively studied: George Andrews and Bruce Berndt have written five books about them! Here is page 341 of Ramanujan’s *Lost Notebook*, where he came up with a method for finding an infinite family of integer solutions to the equation :

As you can see, one example is

In Section 8.5 of George Andrews and Bruce Berndt’s book

*Ramanujan’s Lost Notebook: Part IV*, they discuss Ramanujan’s method, calling it “truly remarkable”.

In short, Ramanujan was well aware of the special properties of the number 1729 before Hardy mentioned it. And something prompted Ramanujan to study the equation again near the end of his life, and find a new way to solve it.

Could it have been the taxicab incident??? Or did Hardy talk about the taxi *after* Ramanujan had just thought about the number 1729 yet again? In the latter case, it’s hardly a surprise that Ramanujan remembered it.

Thinking about this story, I’ve started wondering about what really happened here. First of all, as James Dolan pointed out to me, you don’t need to be a genius to notice that

Was Hardy, the great number theorist, so blind to the properties of numbers that he didn’t notice *either* of these ways of writing 1729 as a sum of two cubes? Base ten makes them very easy to spot if you know your cubes, and I’m sure Hardy knew and .

Second of all, how often do number theorists come out and say that a number is *uninteresting*? Except in that joke about the “least uninteresting number”, I don’t think I’ve heard it happen.

My wife Lisa suggested an interesting possibility that would resolve all these puzzles:

**Hardy either knew of Ramanujan’s work on this problem or noticed himself that 1729 had a special property. He wanted to cheer up his dear friend Ramanujan, who was lying deathly ill in the hospital. So he played the fool by walking in and saying that 1729 was “rather dull”.**

I have no real evidence for this, and I’m not claiming it’s true. But I like how it flips the meaning of the story. And it’s not impossible. Hardy was, after all, a bit of a prankster: each time he sailed across the Atlantic he sent out a postcard saying he had proved the Riemann Hypothesis, just in case he drowned.

We could try to see if there really *was* a London taxi with number 1729 at that time. It would be delicious to discover that it was merely an invention of Hardy’s. But I don’t know if records of London taxi-cab numbers from around 1919 still exist.

Maybe I’ll let C. P. Snow have the last word. After telling his version of the incident with Hardy, Ramanujan and the taxicab, he writes:

This is the exchange as Hardy recorded it. It must be substantially accurate. He was the most honest of men; and further no one could possibly have invented it.

A great insight into the Ramanujan technique of finding a general solution, but then pumping out endless special cases.

To me, the fact that Ramanujan said on the spot that 1729 was the

leastsolution undermines the notion that this is the first time he ever thought of it.I like Lisa’s suggestion. Erdos did something similar when Stan Ulam was in the hospital after a brain operation, not to the point where Erdos was playing a fool, but giving Ulam puzzles as a way to assure him that his brain was still plenty strong.

There was a 2015 movie about Ramanujan, The Man Who Knew Infinity, with Dev Patel of Slumdog Millionaire as Ramanujan and Jeremy Irons as Hardy. They duly enacted a version of that scene, but it landed with a dull muted thud. I doubt anyone not knowing the story already even realized what happened!

I saw that movie, which I generally liked—in part because I like Jeremy Irons, I like Hardy and Ramanujan, and I like any movie that makes a halfway reasonable attempt at talking about mathematicians or scientists. But I don’t remember that scene at all! I was trying to remember it just now, to see how much the story had been exaggerated. Maybe not enough?

Yes, I recall that you don’t like unrealistic portrayals of mathematicians in movies. From my memory (actually my file of quotations, but I remember that it is there), you once wrote:

Remember, old statisticians never die; they just get broken down by age and sex. :-)

Here’s the clip:

It happens so quickly and so undramatically that I’m not surprised you missed it. :-)

(I also liked the movie, overall.)

There is a Wikipedia entry on the Taxicab number.

The same opinion is expressed by Richard Borcherds here

Introduction to number theory lecture 1

To save other people the trouble, it’s at the very end of his lecture.

Any relation to Virginia?

I’m not sure I understand the question, but I was born and raised in Virginia.

Behold my psychic powers! From a blog comment, I know where you were born! :-D

OK, there is no connection. :-)

Trimble is not very common as a name, and there is a well known astronomer named Virginia Trimble.

Oh, I see. I didn’t know if you somehow knew me from Virginia in my distant past.

I think I’ve heard of her, but we’re not related AFAIK. The name ‘Trimble’ is held to be a variation of Turnbull. You’re right, it’s not that common.

And now I’ve just learned that Deborah Harry’s birthname was Angela Trimble — get a load of that!

In one of Feynman’s anecdote books, he told a story about getting into a duel with an abacus salesman. The last and most dramatic problem they race to solve is taking the cube root of 1729.03, which Feynman realizes he can do in his head because he happens to remember that there are 1728 cubic inches in a cubic foot, and the 1.03 can be handled with Taylor series. If I recall correctly, I read the Feynman story before I read the Hardy–Ramanujan story, so the first time I encountered the latter, I was half-unsurprised. I have no great talent for number theory, then or now, and so when I consider how much better at it Hardy would have been, I find it pretty plausible that Hardy knew all about 1729. I like the “he played the fool” explanation for that reason, and because I find it charming.

Speaking of Feynman, I’m reminded how he would astonish people by solving problems on the spot – he had, of course, independently worked out the problems before, and could just present his results. Ramanujan may have done similar feats likewise.

This merely means that their feat is impressive in a

differentway, of course. Like the stage magician who tricks us because we can’t imagine anyone going to such trouble, we can’t imagine being so interested in physics or number theory as to work out and recall all these problems and, say, go through every integer <10,000 and learn every property one can.1729 = sum of cubes of 1,3,3,7,11

It is also the third Carmichael number.

The sum of cubes of 6 and 8, mentioned just below 1729, is actually the smaller number…1729 is NOT the “smallest” … am sure Ramanujan realized it too :)

Laxmanan

But that one involves negative integers, and if we really go ahead and allow negative integers everywhere there’s no smallest integer that’s the sum of two cubes of integers in two different ways.

Reading C. P. Snow’s foreward to Hardy’s

A Mathematician’s Apology, I see that after he tells his version of story of Hardy, Ramanujan and the taxicab, he writes:The last part is an echo of what Hardy said about some of the formulas in Ramanujan’s first letter to him:

This sort of sums up the last sentence in the comment above:

https://www.smbc-comics.com/comic/dialog

I guess. The idea that the dominant invents the “safe word” seems a little off, but what do I know.

Read objectively, this seems to be a failure of imagination on Snow’s part. (I think he was a little star-struck by Hardy.)

I was interpreting it as a kind of joke based on Hardy’s famous remark about Ramanujan.

No doubt that he was alluding to what Hardy famously said about the letter from India. But apparently Snow fails to imagine a possibility other than Hardy innocently commenting on the dullness of 1729.

There are two very good books about Ramanujan that are worth worth reading:

1- The Man Who Knew Infinity : A Life of the Genius Ramanujan by Robert Kanigel. There is also movie of the same name referred to in some of the comments.

2- The Indian Clerk by David Leavitt.

The first one is accurate and the second one has taken some liberty with facts (narrated in the end) to make the book interesting.

Both are worth anyone’s time and money.

Here you can read more about the person at QUEST FOR A MILLION DOLLARS: Srinivasa Ramanujan – The Genius .

Ramanujan for ever will remain a puzzle for future generations.

I forget where I heard the version

“What was your taxicab number?”

“Oh, something uninteresting…. 14.”

“What do you mean ‘uninteresting’? It’s the smallest number that’s the product of 2 and 7 in two different ways.”

Somewhere there’s a planet where people are much worse at math than here—and that planet has its Ramanujan.

I vote for Lisa’s explanation. Hardy was all over this stuff like a cheap suit and it is unthinkable he would not have known or be surprised by such a low level observation. It was his way of having a bit of cheery mathematical badinage with Ramanujan in his last days. Far more perplexing is what went on between Bohr and Heisenberg in Copenhagen and why.

It’s interesting to hear you like Lisa’s theory.

I hope everyone here has seen, or can someday see, a performance of the play

Copenhagen. It’s quite good.When I was an undergrad, I worked at MIT’s Cyclotron Lab, i.e., the building where the electromagnet from the original cyclotron had been left because it was too heavy to move, and then repurposed for other tasks that needed a strong magnetic field. The play

Copenhagencame to Boston, and their publicity people thought it would be neat to have the cast visit a lab that had equipment from the era of the play. I don’t know if they knew ahead of time that the lab director knew Heisenberg, but they enjoyed the story, which he definitely liked to tell:We got free tickets to see the play, and after their last night performing in Boston, we joined the actors for a late dinner in Chinatown.

One of the things about Heisenberg that I can’t quite fathom is that he was not really across matrices! It took Max Born and Pascual Jordan to stiffen up his treatment of the commutativity concept.At least this is what some of the commentaries suggest. There is a reference to a meeting with Einstein to discuss matrices in one source. I can’t judge whether these perspectives are true or not. Maybe there is a deathbed scene with Heisenberg and someone playfully says “Werner, you remember back in the 20s there were those things and they didn’t…what’s the word? – commute? What’s the story with that?”

Peter Haggstrom wrote:

Apparently at that time physicists did not routinely learn about matrices, so Heisenberg reinvented them! Then his thesis advisor, Max Born, said something like “hey, you’ve reinvented matrices—go read about them”.

I have often wondered about this. It is true that you hardly have to be a genius to see that you can write 1729 as the sum of the cubes of 1 and 12 and also of 9 and 10 (even I spotted it). The genius bit is knowing that it cannot be done in any other way.

I have always thought that there would be some clever proof along that lines that 1 and 12 are as far apart as possible whilst 9 and 10 are as close together as possible. This suggests to me that there are some related curves or such like that could be drawn to prove this (I am being really vague here but this is the point, I have never managed to figure it out).

It would be great to see an actual proof distilled from Ramanujan’s work. My suspicion has always been that he had worked through such a proof before the taxi incident, at least informally and perhaps with other numbers.

You write:

…This is one of three notebooks Ramanujan left behind after his death…and the results in this one were written down before he first went to England. In Item…he describes his method (for finding finding solutions of Euler’s diophantine equation a^3 + b^3 = c^3 + d^3) and lists many example solutions, the simplest being 1^3 + 12^3 = 9^3 + 10^3.

So it would be really good to see this proof.

Copying my comment from Hacker News:

“I remember once going to see him 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 cubes in two different ways.”

The quote above is from G. H. Hardy himself, from the book “Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work”. There was no need for him to embellish the story while it was published to “cheer up” Ramanujan, since the book was published in 1940 after Ramanujan’s death.

Two great men can have different interests in the same field. It does not mean one of them had less ability. Hardy, since his early days, was fascinated by pure mathematics and rigor. Ramanujan was playing with numbers on pieces of paper since he was a child. That’s why their contributions and intuitions, even though in the same broad field, are so different.