If $a,b,c \in \mathbb{Z}$ and $a^2 - b^2 = c$ then $a = \frac{m+n}{2}, b = \frac{m-n}{2}$ [duplicate]

Let $a,b,c \in \mathbb{Z}$.

Proove that if $a^2 - b^2 = c$ then exists $m,n \in \mathbb{Z}$ which are both even/odd such that

$a = \frac{m+n}{2}, b = \frac{m-n}{2}, c = mn$

I think I should use Fermat's theorem, but I'm not sure how to do it

marked as duplicate by Martin R, user491874, Community♦Jan 7 '18 at 17:46

• Doesn't $a^2+b^2=c$ then turn into $m^2+n^2=mn$? if both $m$ and $n$ are odd it cannot hold – user310648 Jan 7 '18 at 17:42
Suppose $c$ is odd. Then $c-1$ and $c+1$ are even, implying $\frac{c-1}{2}$ and $\frac{c+1}{2}$ are integers. Then take $m=c,n=1$ getting integral solutions for $a,b$.
If $c$ is even then $c=2^nk$ for some odd integer $k$, where $n$ is the highest power of $2$ in $c$. If $n\ge 2$, take $m=2^{n-1}k$ and $n=2$. If $n=1$, then $a^2+b^2=c$ has no solution of the above form. Butobviously it might have other solutions.