
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).


int N, I, J, SI, SJ, Count, Tally;
[Count:= 0;  N:= 0;
repeat  Tally:= 0;
        I:= 1;
        repeat  J:= I+1;
                repeat  if N = I*I*I + J*J*J then
                            [Tally:= Tally+1;
                            if Tally >= 2 then
                                [Count:= Count+1;
                                IntOut(0, Count);  Text(0, ": ");
                                IntOut(0, N);  Text(0, " = ");
                                IntOut(0, SI); Text(0, "^^3 + ");
                                IntOut(0, SJ); Text(0, "^^3 = ");
                                IntOut(0, I);  Text(0, "^^3 + ");
                                IntOut(0, J);  Text(0, "^^3");
                                CrLf(0);
                                J:= 1000;  I:= J;
                                ];
                            SI:= I;  SJ:= J;
                            ];
                        J:= J+1;
                until   I*I*I + J*J*J > N;
                I:= I+1;
        until   I*I*I*2 > N;
        N:= N+1;
until   Count >= 25;
]