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


#MAX=1189
 
Macro q3(a,b)
  a*a*a+b*b*b
EndMacro
 
Structure Cap
  x.i
  y.i
  s.i
EndStructure
 
NewList Taxi.Cap()
 
For i=1 To #MAX  
  For j=i To #MAX 
    AddElement(Taxi()) : Taxi()\s=q3(i,j) : Taxi()\x=i : Taxi()\y=j 
  Next j  
Next i
 
SortStructuredList(Taxi(),#PB_Sort_Ascending,OffsetOf(Cap\s),TypeOf(Cap\s))
 
If OpenConsole()    
  ForEach Taxi()
    If sum=Taxi()\s
      r$+"="+RSet(Str(Taxi()\x),4)+"³ +"+RSet(Str(Taxi()\y),4)+"³ " : Continue
    EndIf
    If CountString(r$,"=")>=2 : c+1 : EndIf    
    If CountString(r$,"=")=2      
      Select c
        Case 1 To 25, 2000 To 2006 : PrintN(RSet(Str(c),5)+": "+RSet(Str(sum),10)+r$)        
        Case Bool(c>2006) : Break
      EndSelect        
    EndIf
    r$=""      
    sum=Taxi()\s : r$="="+RSet(Str(Taxi()\x),4)+"³ +"+RSet(Str(Taxi()\y),4)+"³ "    
  Next  
  PrintN("FIN.") : Input()
EndIf