Cast your mind back to high school math lessons, and you’ll no doubt be able to recall that prime numbers are numbers divisible only by themselves and 1—like 13, 17, 19, and 23.

If you’re not a mathematician, that’s probably the only named set of digits that you can bring to mind, but prime numbers are just one of many quirkily-named groups of digits that math wizards have come up with. A so-called abundant number, for instance, is a number that is smaller than the sum of its divisors—so 12 is smaller than 1 + 2 + 3 + 4 + 6, which totals 16. If a number is equal to the total of its divisors, then it’s called a perfect number—like 6, which equals 1 + 2 + 3. Cousin numbers are pairs of prime numbers that are four digits apart, like 3 and 7, or 7 and 11. Twin primes differ by just two (like 3 and 5, or 5 and 7), while pairs of prime numbers that are six places apart (like 5 and 11) are somewhat colorfully known as sexy primes. But of all the quirky number names in the mathematical textbooks, perhaps one of the strangest—and the most complex—is the taxicab number.

Taxicab numbers are numbers that can be expressed as the sum of two cubes in two different ways. In other words, a number, x, can be called a taxicab so long as x = a3 + b3 and c3 + d3. If you can replace the — a, b, c, and d in those equations with four different whole numbers there, then you’ve got a taxicab.

These kinds of numbers are extraordinarily rare, and incredibly only six taxicabs have ever been discovered. The first and smallest of these is technically 2 — because it is the sum of the reversible calculation 13 + 13. After that, you won’t come across another taxicab number until you reach 1,789 — which is equal to both 13 + 123, and 93 + 103. From there, the third taxicab number is 87,539,319; the fourth is 6,963,472,309,248; and the fifth is 48,988,659,276,962,496. The sixth and largest taxicab number yet discovered as yet — 24,153,319,581,254,312,065,344 — was identified as recently as 2003. (That’s just over 24 sextillions, should you want to read it out!)

But one question remains: Why are these numbers called taxicabs?

This particular story begins with a British mathematician and Cambridge University scholar named GH Hardy, and his longtime friend and mathematical research collaborator, the Indian mathematician Srinivasa Ramanujan. Together, Hardy and Ramanujan first began working on numerous mathematical projects in 1913 by postal communication, when Ramanujan initially sent nine pages of mind-boggling handwritten mathematical formulae from his home in India to Hardy’s office at Cambridge. Impressed by Ramanujan’s obvious natural talent for numbers, Hardy arranged for him to travel to England to meet, and the pair soon began several years’ worth of highly productive collaboration.

In the late 1910s, Ramanujan suddenly took ill and was hospitalized in London. On hearing the news, Hardy quickly took the train from Cambridge, and then jumped into a cab at the station to head straight to the hospital to see him. To pass the time on his cab journey across the city, Hardy began pondering what mathematical properties the number of the taxicab he happened to have caught—1789—might have.

On arriving at the hospital, Hardy told Ramanujan that he was a bit dismayed that the number 1789 seemed to him to be a “rather dull” number, with few interesting properties—and that he hoped its apparent dreariness wasn’t an “unfavorable omen” for his friend’s medical treatment. “No,” Ramanujan replied, with a smile. “It is actually a very interesting number: it is the smallest number expressible as the sum of two cubes in two different ways.”

Numbers sharing this peculiar quality have since become known as “taxicabs”—while the number 1789 itself is now known as the “Hardy-Ramanujan” number in honor of its unlikely discoverers. Today, it is just one of several mathematical first that bear this extraordinary duo’s names.