**1729** is the **Hardy–Ramanujan number** after a famous anecdote of the British mathematician G. H. Hardy regarding a visit to the hospital to see the Indian mathematician Srinivasa Ramanujan. In Hardy’s words:

I remember once going to see him (Ramanujan) 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 [positive] cubes in two different ways.”

The two different ways are:

**1729 = 1**^{3}+ 12^{3}= 9^{3}+ 10^{3}

The quotation is sometimes expressed using the term “positive cubes”, since allowing negative perfect cubes (the cube of a negative integer) gives the smallest solution as 91 (which is a divisor of 1729):

**91 = 6**^{3}+ (−5)^{3}= 4^{3}+ 3^{3}

Numbers that are the smallest number that can be expressed as the sum of two cubes in *n* distinct ways have been dubbed “**taxicab numbers**“.

**Taxicab Numbers**

The *n*th **taxicab number**, typically denoted Ta(*n*) or Taxicab(*n*), is defined as the smallest number that can be expressed as a sum of two *positive* algebraic cubes in *n* distinct ways.

The concept was first mentioned in 1657 by Bernard Frénicle de Bessy. G. H. Hardy and E. M. Wright proved that such numbers exist for all positive integers *n*, and their proof is easily converted into a program to generate such numbers. However, the proof makes no claims at all about whether the thus-generated numbers are *the smallest possible* and thus it cannot be used to find the actual value of Ta(*n*).

The restriction of the summands to positive numbers is necessary, because allowing negative numbers allows for more (and smaller) instances of numbers that can be expressed as sums of cubes in *n* distinct ways. The concept of a cabtaxi number has been introduced to allow for alternative, less restrictive definitions of this nature. In a sense, the specification of two summands and powers of three is also restrictive; a generalized taxicab number allows for these values to be other than two and three, respectively.

**Known Taxicab Numbers**

So far, the following six taxicab numbers are known (sequence A011541 in OEIS):

**Ta(2)**, also known as the**Hardy–Ramanujan number**, was first published by Bernard Frénicle de Bessy in 1657. The subsequent taxicab numbers were found with the help of supercomputers.- John Leech obtained
**Ta(3)**in 1957. - E. Rosenstiel, J. A. Dardis and C. R. Rosenstiel found
**Ta(4)**in 1991. - J. A. Dardis found
**Ta(5)**in 1994 and it was confirmed by David W. Wilson in 1999. -
**Ta(6)**was announced by Uwe Hollerbach on the NMBRTHRY mailing list on March 9, 2008, following a 2003 paper by Calude et al. that gave a 99% probability that the number was actually Ta(6). - Upper bounds for
**Ta(7) to Ta(12)**were found by Christian Boyer in 2006.

Check out my C code here to generate Ramanujam Numbers: https://github.com/girish17/mYPrograms/tree/master/RamanujamNumbers

LikeLike

Pretty expressive and clear code. Thanks for sharing Girish.

LikeLike