TITLE: Algorithm to find the numbers expressible as the sum of two positive cubes in two different ways
QUESTION [5 upvotes]: I have known this from beginning that $1729$ is the smallest number expressible as the sum of two cubes in two different ways: 
$$ 12^3 + 1^3 $$
and 
$$ 10^3+9^3 $$
I am a Software Developer and if someone can tell me the logic to write a program for printing such types of number will be greatly helpful.

REPLY [2 votes]: This would be essentially solutions to the Diophantine equation, $a^3+b^3=c^3+d^3.$ Which I believe Euler solved for all rational numbers with :$(3a^2+5ab−5b^2)^3+(4a^2−4ab+6b^2)^3+(5a^2−5ab−3b^2)^3 = (6a^2−4ab+4b^2)^3$
This can be rewritten as 
$(A^2+7AB−9B^2)^3+(2A^2−4AB+12B^2)^3 = (2A^2+10B^2)^3+(A^2−9AB−B^2)^3$
with $a=A+B, b=A-2B.$
The solutions to all integer values only I don't believe has been found, but the solution to some integer values at least has been, and can be found in this paper by Marc Chamberland from 1999:
http://www.fq.math.ca/Scanned/38-3/chamberland.pdf
(This is the first answer I posted in this site so I'm not sure if my format for posting is correct, apologies if not)