When can an even number be written as the difference between two squares?

75 Views Asked by At

When(What properties should a number have) can an even number be written as the difference between to perfect squares?

Here's what I've tried:

Let $n$ be that number and let $x^2$ and $(x+y)^2$ be two squares.Then $(x+y)^2 - x^2 = 2xy + y^2$ so we are looking for two positive integers $x$ and $y$ so $n = 2xy + y^2$. $n$ is even so $y$ needs to be even as well so we have $m = xy + y^2/2$ where $2m = n$ but I don't know where to go from here. Thanks in advance!

2

There are 2 best solutions below

0
On BEST ANSWER

If $n$ is even and $n=a^2-b^2$ for two integers $a$ and $b$, then, since $n$ is even, $a$ and $b$ are both odd or both even. So, both numbers $a+b$ and $a-b$ are even and therefore, since $n=(a-b)(a+b)$, $4\mid n$.

On the other hand, if $4\mid n$, then$$n=\left(\frac n4+1\right)^2-\left(\frac n4-1\right)^2.$$

0
On

Our first observation: if $n$ is even, $y$ must be even. If it weren't, then $n=2xy + y^2$ would be an even number plus an odd number, yielding an odd number. Set $y = 2z$, and our equation becomes $n = 4xz + 4z^2$, for natural numbers $x$ and $z$. We can now say that $4$ divides $n$.

Is that it? Well, let's do another substitution: let $n = 4k \implies k = xz + z^2$. Can every natural number $k$ be represented as $xz + z^2$, for some natural numbers $x$ and $z$? The answer is yes: $xz + z^2 = z (x + z)$, so we just choose $z = 1, x = k - 1$. Back substituting all of these values, we actually get that in fact every multiple of $4$, $n$, can be written as follows: $$n = \bigg(\frac{n}{4}+1\bigg)^2 - \bigg(\frac{n}{4}-1\bigg)^2 = a^2 - b^2.$$ You can see $a, b \in \mathbb{N}$ if and only if $4$ divides $n$.