# If you have a number that is the difference of 2 squares, is it odd?

I know that the question "Prove that if $n$ is odd, it is the difference between two squares" has been answered here:

Prove every odd integer is the difference of two squares

But I want to know if the converse of that is true, I think it must be something like this:

$2k = A^2 - B^2$ but I am unsure.

• Not necessarily, $4^2-2^2$ is not odd, $5^2-3^2$ is not odd. – André Nicolas Jan 22 '14 at 23:52
• Useless characters: $0^2-0^2=0$. – Git Gud Jan 22 '14 at 23:54
• It is hard to imagine how the same person could be both interested enough to ask this question and uninterested enough not to check a couple of examples before posting. – WillO Jan 22 '14 at 23:58
• – lhf Jan 22 '14 at 23:59

Note that $A^2$ is odd iff $A$ is odd, same for $B$

Thus $A^2-B^2$ is even iff exactly one of the numbers $A$ and $B$ is even. Otherwise it is odd!

• Was writing that down but no need to write it again! Perfectly explained here. – user88595 Jan 22 '14 at 23:58
• Thank you! i don't know why I didn't see this on my own. – Sarah Jan 23 '14 at 0:03

How about $4^2-2^2=16-4=12?$...

We can address this question without knowing anything about multiplication, factorization, or squaring; all we need is subtraction! Given any three numbers $a,b,c$, either $a-b$ is even, or $a-c$ is even, or $(a-b)-(a-c)=c-b$ is a difference of odd numbers, hence even.

Now, you can apply this result to your favorite three squares. You can also apply it to any set containing at least three numbers, regardless of their origin: cubes, primes, the population of Timbuktu during full moons, etc.

The square of any number has the same parity (odd-even) as the number being squared.

The difference of two numbers is even if the numbers have the same parity.

The difference of two numbers is odd if the numbers have different parity.

A numbers $n$ can be expressed as the difference of two squares iff $n$ is odd or $n$ is a multiple of $4$.

In both cases, it is easy to explicitly find $a$ and $b$ such that $n=a^2-b^2$ using $a^2-b^2=(a-b)(a+b)$ and the simplest factorization you can think of.