3
$\begingroup$

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.

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

You have left out 1 and 4. The question is about the difference of the squares of the two positive integers.

Your argument can be better phrased as:

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$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.