(In reply to
re: soln by K Sengupta)
Thanks for the generous hint. Right, the possibility of negative integers. I missed that.
If we arrange the two cubes in ascending order: n^3, (n+m)^3, then m will be positive, no matter the sign of n. In the previous post I considered n and m positive. Now we include the two remaining cases. Case #1: n negative and (n+m) negative, and Case #2: n negative and (n+m) positive.
Case #1 Using both negative cube roots is symmetric about the origin to using both positive cube roots. The only solution for the positive integers was:
(+5)^3 - (+3)^3 = 98
This maps into the only solution for the negative integers:
(-3)^3 - (-5)^3 = 98
Case #2 Subtracting a negative integer cubed is identical to adding
the absolute value of that integer cubed, so we are really now asking if any of the values supplied is the sum of two cubes. Doing a quick search, we find only one pair: 9 = 1 + 8. In terms of the problem:
2^3 - (-1)^3 = 9
What is nice about using the m^3 + 3(m n^2 + m^2 n) search (see the first post) and also using the sum of cubes search, is that we can be sure we found all (three) solutions.
lord@rabbit 12754 % difc1
987654321 no solution
98765432 no solution
9876543 no solution
987654 no solution
98765 no solution
9876 no solution
987 no solution
98 = ( 5)^3 - ( 3)^3
98 = (-3)^3 - (-5)^3
9 = ( 1)^3 - (-2)^3
lord@rabbit 12754 %
Edited on October 24, 2022, 3:15 am