# if $m^2 = a^3 - b^3$, then $m$ is the sum of two squares.

How could I prove that : $$\text{If} \space m^2=a^3-b^3\text{ where}\space m,a,b\in\mathbb{N} \rightarrow \exists c,d \in\mathbb{N}\space \text{ such that}\space m=c^2+d^2$$ thanks for helping

Edit: I told the person who gave me this question it's wrong, and he corrected it like this: $$\text{If} \space m^2=(a+1)^3-a^3\text{ where}\space m,a\in\mathbb{N} \rightarrow \exists c,d \in\mathbb{N}\space \text{ such that}\space m=c^2+d^2$$ It's such an easy question and I already know the answer.

Edit2:I though I know this question answer but after thinking I can't solve this, could any one help me to figure out how to solve this?(I hope it wasn't wrong like previous question, but if you think it's wrong please let me know,I need to solve this question for exam I wanna take from my students.)

Edit 3: the second question wasn't wrong and has been answered at this link.

-
Does your definition of the set of natural numbers includes zero ? – pedja Jan 16 '12 at 19:07
What is the source of the problem? – Jonas Meyer Jan 16 '12 at 19:07
@pedja it dose not matter – Lrrr Jan 16 '12 at 20:21
@JonasMeyer I dont know some one ask this from me – Lrrr Jan 16 '12 at 20:22

Let $a=90$, $b=54$. Then $$a^3-b^3=571536=2^4\cdot3^6\cdot7^2$$ and hence $$m=2^2\cdot 3^3\cdot 7.$$ This cannot be written as the sum of two squares since it has prime factors congruent to $3$ modulo $4$ which appear to an odd power. (Violating Fermat's condition)
Edit: The smallest example occurs when we take $a=10$, $b=6$, as then $$a^3-b^3=784=(28)^2$$ so that $m=2^2\cdot 7$. This cannot be written as the sum of two squares since we cannot write $7$ as the sum of two squares.
Nice solution! One can start from many $x$, $y$ such that $x^3-y^3$ is "bad" and multiply $x$ and $y$ by suitable $k$ so that $k^3(x^3-y^3)$ is a perfect square. This leads to the question whether $a$ and $b$ can be relatively prime. They can, for $71^3-23^3=588^2$, and $588$ is not the sum of two squares. – André Nicolas Jan 16 '12 at 21:27
@AliAmiri: Yes this is true. It is not easy, but it is true. You are looking at Pells Equation, and the solutions for $m$ are given by the continued fraction expansion for $\sqrt{3}$, and you can rewrite this using a recurrence relation. Playing with this relation, you can eventually prove that if $m^2=(a+1)^3-a^3$, then we have $m=c^2+d^2.$ Moreover, we can actually show that these are consecutive squares. That is $m^2=n^2+(n+1)^2$ for some $n$. I think this deserves its own question, as you find some interesting answers there. – Eric Naslund Jan 19 '12 at 14:07
@EricNaslund thanks to your kind help yes i have guess about $m=n^2+(n+1)^2$ but i don't have any idea how to prove this. and also i asked this question in new question. – Lrrr Jan 19 '12 at 14:15
@EricNaslund I think you are wrong about : $m^2 = n^2 + (n+1)^2$ it is : $m = n^2 + (n+1)^2$ – Lrrr Jan 19 '12 at 14:19