<s>[INST] $x^2-y^2=n$ has solution in $\Bbb Z$ IFF : $n \not \equiv 2 \pmod 4$ suppose $n\in \Bbb Z $   then how to prove this statement:
$x^2-y^2=n$ has  solution in $\Bbb Z$ IFF :    $n \not \equiv 2 \pmod 4$
 [/INST] tnx for Gerry Myerson.
it's equal with this statement:
$x^2-y^2=n$ iff $ n$ is odd or $4|n$
$(x-y)(x+y)=x^2-y^2=n=ab , \exists a,b \in \Bbb Z$
so we have ($x+y=n$,$x-y=1$ or $x-y=n$,$x+y=1$ ) that $n$ must be odd or   $x=\frac{a+b}{2}, y=\frac{a-b}{2}$ that so two case exists :
$I)$both $a,b$ is even so $4|ab=n$
$II)$ both $a,b$ is odd so $n=ab $ is odd
</s>