TITLE: Numbers written in both forms
QUESTION [9 upvotes]: I have come across the OEIS series A031363. It has this description:

Positive numbers of the form $x^2+xy-y^2$; or, of the form $5x^2-y^2$.

So it is saying that all numbers that can be written in the form $x^2+xy-y^2$ can be written as $5x^2-y^2$.
I am a beginner at Number Theory, so any tips or hints on how to proof it would be great.
EDIT: I have done a tiny computer search on it, and confirmed that all numbers (< 10000) that can be written in the first form can also be written in the second form. So it is saying that both form is identical.

REPLY [4 votes]: 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.