is my proof by contradiction correct?

67 Views Asked by At

Suppose that n is a positive even integer with $n/2$ being odd. Prove that there do not exist positive integers $x$ and $y$ with $x^2−y^2=n$.

Assume that there exist positive integers positive integers $x$ and $y$ such that $x^2-y^2=n$.

then, because $n$ is even, $x$ and $y$ must both be even or $x$ and $y$ must both be odd.

if $x$ and $y$ are both even we obtain $(2k)^2-(2j)^2$.

and therefore, $4(k^2-j^2)=n$.

if we divide by $2$ we get $2(k^2-j^2)=n/2$ where $2(k^2-j^2)$ is even by definition and $n/2$ is odd. We have a contradiction.

if $x$ and $y$ are both odd we obtain $(2k+1)^2-(2j+1)^2$.

and therefore $4k^2+4k+1-(4j^2+4j+1)=4(k^2+k-j^2-j)=n$.

if we divide by $2$ we get $2(k^2+k-j^2-j)=n/2$ where $2(k^2+k-j^2-j)$ is even by definition and $n/2$ is odd. We have a contradiction.

qed