
A   taxicab number   (the definition that is being used here)   is a positive integer that can be expressed as the sum of two positive cubes in more than one way.



The first taxicab number is   1729,   which is:

 13   +   123       and also
 93   +   103.


Taxicab numbers are also known as:

   taxi numbers
   taxi-cab numbers
   taxi cab numbers
   Hardy-Ramanujan numbers


Task

 Compute and display the lowest 25 taxicab numbers (in numeric order, and in a human-readable format).
 For each of the taxicab numbers, show the number as well as it's constituent cubes.


Extra credit
 Show the 2,000th taxicab number, and a half dozen more


See also

 A001235: taxicab numbers on The On-Line Encyclopedia of Integer Sequences.
 Hardy-Ramanujan Number on MathWorld.
 taxicab number on MathWorld.
 taxicab number on Wikipedia   (includes the story on how taxi-cab numbers came to be called).


 
# Project : Taxicab numbers
 
num = 0
for n = 1 to 500000
    nr = 0
    tax = []
    for m = 1 to 75
        for p = m + 1 to 75
            if n = pow(m, 3) + pow(p, 3)
               add(tax, m)
               add(tax, p)
               nr = nr + 1
            ok
        next
    next
    if nr > 1
       num = num + 1
       see "" + num + " " + n + " => " + tax[1] + "^3 + " + tax[2] + "^3" + ", "
       see "" + tax[3] + "^3 +" + tax[4] + "^3" + nl
       if num = 25
          exit
       ok
    ok
next
see "ok" + nl
 