# If the difference of cubes of two consecutive integers is a square, then the square can be written as the sum of squares of two different integers.

How can i prove the statement that if the difference of cubes of two consecutive integers is an integral power of 2, then the integer with power 2 can be written as the sum of squares of two different integers.

For example:

$$8^3 - 7^3 = 13^2 = 12^2 + 5^2$$

Any help appreciated.

Thanks.

-
This is true of any odd square... See en.wikipedia.org/wiki/… – Brandon Carter Jun 21 '13 at 20:58
@BrandonCarter i want to know how can i prove this. – SHOBHIT GAUTAM Jun 21 '13 at 21:01

We can see that $$n^3-(n-1)^3=3n^2-3n+1.$$ By looking at congruences modulo 4, we see that $$n^3-(n-1)^3=1\pmod 4.$$ Recalling that you assumed that the difference was a square, you can apply Fermat's theorem cited above to conclude.
Im pretty sure youve heard of an identity $$a^3-b^3=(a-b)*(a^2 + b^2 + ab)$$
If the above is a perfect square then it must be of form $a+b=n$ and $a^2 + b^2 + ab = n x^2$.