Numbers written in both forms

If one of $x$, $y$ is even, WLOG let $x = 2a$. Same as what Bob Krueger said, $x^2 + xy - y^2 = 5a^2 - (a-y)^2$

If both $x$ and $y$ are odd, then $x + y$ and $x + 3y$ are even. We can check $x^2 + xy - y^2 = 5\left(\frac{x + y}{2}\right)^2 - \left(\frac{x + 3y}{2}\right)^2$


It seems to me that there is a case missing in the accepted answer. I don't see how we can take $x=2a$ "without loss of generality," because the form $x^2+xy-y^2$ is not symmetric in $x$ and $y.$ Indeed, when $y=2a,$ we have $x^2+xy-y^2 = x^2+2ax-4a^2=2x^2-(2a-x)^2,$ and I don't see how to put this in the required form.

However, when $y$ is even, we have $$5\left(x-\frac{y}{2}\right)^2-\left(2x-\frac{3y}{2}\right)^2=x^2+xy-y^2,$$

so the theorem is true is this case too.

As I noted in a comment on the accepted answer, the identity $$5u^2-v^2=(3u-v)^2+(3u-v)(v-u)-(v-u)^2$$ establishes the converse.