Hardy’s remembered taxi ride
Hardy recalled visiting Ramanujan during his illness and mentioning his seemingly dull taxi number. Ramanujan identified a precise distinction: 1729 is the smallest positive integer that is a sum of two positive cubes in two distinct unordered ways.
Hardy’s account gives us the story. The equalities and the claim of minimality can be checked independently.
Read the sources · Trinity College Annual Record · Ramanujan essay
Find the first collision
Write a ≤ b. For a³ + b³ < 1729, the larger base b is at most 11 because 12³ + 1 reaches 1729. Generate each pair with 1 ≤ a ≤ b, keep the sums below 1729, and sort them. The 60 resulting sums are distinct. At 1729, (1, 12) and (9, 10) give the first duplicate.
This finite check proves the claim because the bound accounts for every eligible pair. Swapping the two bases leaves the unordered pair unchanged. Changing the allowed bases to include zero or negative integers changes the problem.
Search the cube sums
Change the upper bound to see which totals repeat. At the default, there are 60 pairs below 1729 and two pairs at 1729.
- 1³ + 12³ = 9³ + 10³ = 1729
A hidden factorization
The identity a³ + b³ = (a + b)(a² − ab + b²) gives 1729 = 13 · 133 from the first pair and 1729 = 19 · 91 from the second. Factoring either product yields 7 · 13 · 19. The three distinct prime factors lie six apart and generate eight positive divisors, including 1 and 1729.
A composite number that passes Fermat’s test
If a is coprime to 1729, Fermat’s little theorem gives a⁶ ≡ 1 modulo 7, a¹² ≡ 1 modulo 13 and a¹⁸ ≡ 1 modulo 19. Each exponent divides 1728. Raising to that common exponent shows that 7, 13 and 19 each divide a¹⁷²⁸ − 1, so their product divides it too.
Numbers with this property are called Carmichael numbers. A Fermat test can rule out a prime candidate when the congruence fails. Passing it can leave a composite candidate in play. For 1729, the stronger Miller–Rabin test with base 2 starts at 2²⁷ ≡ 645 and squares to 1065, then to 1. It reaches 1 without the required initial 1 or a prior −1, detecting compositeness.
Read the sources · Alford, Granville and Pomerance · There Are Infinitely Many Carmichael Numbers
From two cubes to an elliptic curve
Set s = x + y and d = x − y for a solution of x³ + y³ = N. Expanding gives 4N = s³ + 3sd². When N ≠ 0, put X = 12N/s and Y = 36Nd/s. Then the equation becomes:
For N = 1729, (x, y) = (1, 12) and (9, 10) give (X, Y) = (1596, −52668) and (1092, −3276). These are two rational points on one elliptic curve. Determining the full set of rational points up to the curve’s group law is a much deeper question. Ono and Trebat-Leder studied a related family through a K3 surface coming from Ramanujan’s work on equal cube sums.
Read the sources · Ono and Trebat-Leder · The 1729 K3 surface · Published erratum
How far can the pattern go?
The next record for three representations is 87,539,319 = 167³ + 436³ = 228³ + 423³ = 255³ + 414³. Verifying those equalities is a short calculation. Proving they occur at the first possible total requires ruling out earlier triples. A priority queue can do that search with one next candidate per larger base, since the sums for a fixed b grow as a increases.
What is the smallest positive exponent m that works for every coprime base, so that aᵐ ≡ 1 modulo 1729?
Reveal the explanation
The multiplicative groups modulo 7, 13 and 19 are cyclic of orders 6, 12 and 18. The Chinese remainder theorem gives their direct product. Its exponent is the least common multiple, 36.