Which natural numbers can be expressed as the difference of squares of two integers?
Problem
Source:
Tags: number theory, Perfect Squares, IMO Shortlist, IMO Longlist
04.10.2010 11:55
My solution: Consider the number $n=a^2-b^2=(a-b)(a+b)$. Note that $(a-b), (a+b)$ have same parity and hence $n$ is odd or a multiple of $4$. All such $n$ works because for odd $n$,we have $\left(\frac{n+1}{2}\right)^2-\left(\frac{n-1}{2}\right)^2=n$ and for $n$ being a $4-$multiple, we have $n=\left(\frac{n+4}{4}\right)^2-\left(\frac{n-4}{4}\right)^2$
10.10.2010 16:46
$n^2-(n-1)^2=2n+1,(n+2)^2-n^2=4(n+1)$
03.06.2022 03:26
The answer is $\boxed{\text{all odd numbers and multiples of }4}$ or equivalently $\boxed{\text{anything that isn't }2\pmod 4}$. Note that $\left(\frac{n+1}{2}\right)^2-\left(\frac{n-1}{2}\right)^2=n$, so all odd $n$ work. Also, $\left(\frac{n+4}{4}\right)^2-\left(\frac{n-4}{4}\right)^2=n$, so all multiples of $4$ work. Note that perfect squares are only $0$ or $1$ mod $4$, so their difference can't be $2\pmod 4$, so anything that's $2\pmod 4$ cannot be written as the difference of two squares.
23.08.2022 04:50
The answer is $\boxed{n|n\not\equiv2\pmod{4}}$. Clearly $n\equiv2\pmod{4}$ is unattainable, as $0$ and $1$ are the only quadratic residues mod $4$, which implies that $-1\equiv3$, $0$, and $1$ are the only "difference of squares" residues mod $4$. As for the constructions, take $n=(\tfrac{n+1}{2})^2-(\tfrac{n-1}{2})^2$ for all odd $n$ and $n=(\tfrac{n}{4}+1)^2-(\tfrac{n}{4}-1)^2$ for all $n\equiv0\pmod{4}$, which can be motivated by writing $n=n\cdot1$ and $n=\tfrac{n}{2}\cdot2$ and applying difference-of-squares.