# How many positive integers less than $2011$ cannot be expressed as the difference of the squares of the two positive integers.

How many positive integers less than $2011$ cannot be expressed as the difference of the squares of the two positive integers?

I thought that since the only numbers that are expressible as a difference of squares are numbers that are multiples of $4$ or odd numbers the answer would be the complement of the number of multiples of $4$ between $2011$ and $1$ plus the number of odd numbers between $1$ and $2011$, which is $2010-(502+1005) = 503$. The answer turns out to be $505$, and I don't know why.

Edit: adding in the case of $1$ gives a total of $504$, so I am still missing one.

• Yes, that's good. There is one more. – John Ryan Dec 19 '15 at 3:29

Note $a^2-b^2=(a+b)(a-b)$, but $a+b$ and $a-b$ have the same parity. Hence the only possible numbers are numbers divisible by 4 and odd numbers.
For any odd integer $2n+1\geq3$, we can write it as $(n+1)^2-n^2$.
For any integer divisible by 4, $4n\geq8$, we can write it as $(n+1)^2-(n-1)^2$.
Hence, setting $n=0$ in the first case and $n=1$ in the second case reveal the corner cases, $1$ and $4$.