Mathwords logoMathwords

Taxicab Number — Definition, Formula & Examples

A taxicab number, denoted Ta(n)\text{Ta}(n), is the smallest positive integer that can be expressed as the sum of two positive cubes in nn different ways. The most famous example is Ta(2)=1729\text{Ta}(2) = 1729, which equals both 13+1231^3 + 12^3 and 93+1039^3 + 10^3.

The nn-th taxicab number Ta(n)\text{Ta}(n) is defined as the least positive integer that can be represented as the sum of two positive cubes in at least nn distinct ways, where representations differing only in the order of the summands are not counted as different.

Key Formula

Ta(n)=min{kZ+:k=ai3+bi3 for n distinct pairs (ai,bi) with aibi}\text{Ta}(n) = \min\left\{ k \in \mathbb{Z}^+ : k = a_i^3 + b_i^3 \text{ for } n \text{ distinct pairs } (a_i, b_i) \text{ with } a_i \leq b_i \right\}
Where:
  • Ta(n)\text{Ta}(n) = The n-th taxicab number
  • kk = A positive integer to test
  • ai,bia_i, b_i = Positive integers forming each cube-sum pair

How It Works

To verify a taxicab number, you search for all ways to write it as a3+b3a^3 + b^3 with aba \leq b. The name comes from a famous anecdote: the mathematician G. H. Hardy visited Ramanujan in the hospital and mentioned arriving in taxi number 1729, calling it a dull number. Ramanujan immediately replied that 1729 is actually quite interesting — it is the smallest number expressible as the sum of two cubes in two different ways. Finding higher taxicab numbers requires extensive computation; Ta(3)=87,539,319\text{Ta}(3) = 87{,}539{,}319 was not discovered until 1957.

Worked Example

Problem: Verify that 1729 is the smallest number that can be written as the sum of two positive cubes in two different ways.
Find the first representation: Compute cubes: 13=11^3 = 1 and 123=172812^3 = 1728.
13+123=1+1728=17291^3 + 12^3 = 1 + 1728 = 1729
Find the second representation: Compute cubes: 93=7299^3 = 729 and 103=100010^3 = 1000.
93+103=729+1000=17299^3 + 10^3 = 729 + 1000 = 1729
Confirm it is the smallest: No positive integer less than 1729 has two distinct representations as a sum of two positive cubes. This can be verified by checking all pairs (a,b)(a, b) with aba \leq b and a3+b3<1729a^3 + b^3 < 1729.
Answer: Ta(2)=1729=13+123=93+103\text{Ta}(2) = 1729 = 1^3 + 12^3 = 9^3 + 10^3, confirmed.

Why It Matters

Taxicab numbers sit at the crossroads of number theory and computational mathematics. They appear in discussions of Diophantine equations — equations seeking integer solutions — which are central to both pure math research and modern cryptography. The story of Ramanujan and 1729 is also one of the most celebrated anecdotes in mathematics, illustrating how deep pattern recognition can reveal hidden structure in seemingly ordinary numbers.

Common Mistakes

Mistake: Including representations with zero, such as 03+k3=k30^3 + k^3 = k^3.
Correction: The standard definition of taxicab numbers requires both cubes to come from positive integers (not zero). Using 030^3 would trivially give extra representations.