<s>[INST] Find all values of $n$ for which the Diophantine equation $n=a^2-b^2$ has a solution Let $n$ be an integer. Find all values of $n$ for which the Diophantine equation $n=a^2-b^2$ has a solution for integers $a$ and $b$. For those values of $n$ found in the previous part find all solutions of $n=a^2-b^2$ for integers $a$ and $b$. 
The first part is pretty easy. It is just if $n$ is the product of at least $2$ factors of $2$ or $n$ is the product of solely odd factors.
For the second part, I used this argument. If $n$ is the product of at least two factors of $2$, then let $a+b$ be any factor of $n$ with at least one power of $2$ but less than or equal to one minus the maximum power of $2$ dividing $n$. The value of $a-b$ is just the other part of $n$. On the other hand, if $n$ is the product of solely odd numbers, let $a+b$ be an odd factor of $n$. Then the value of $a-b$ follows and this yields all integer solutions $a, b$.
Is it necessary to formalize my argument into algebra and number theory or is how I put it fine?
 [/INST] The equation $$n=a^2-b^2=(a-b)(a+b)$$ is solveable over the integers if and only if there are numbers $u,v$ with $uv=n$, such that the system $$a-b=u$$ $$a+b=v$$
is solveable over the integers.
The system is solveable if and only if $u$ and $v$ have the same parity. We can find suitable $u$ and $v$, if and only if $n\ne 2\ (\ mod\ 4\ )$. If $n$ is odd, we can simply choose $u=1$ , $v=n$. If $n$ is divisble by $4$, we can choose two even numbers $u,v$ with $uv=n$. In the case $n\equiv 2\ (\ mod\ 4\ )$, one of the factors will be odd and the other even.
So, $n=a^2-b^2$ is solveable over the integers, if and only if $n\ne 2\ (\ mod\ 4\ )$.
</s>