# UNSW School Mathematics Competition Problems 2010

Problem 1

Find the set of all pairs of positive integers $(n,m)$ that satisfy

$$\left|n^2-m^2-2010\right|\le 1.$$

Solution 1
We being by factoring then we seek $n$ and $m$ that satisfy one of the following:
(i) $(n-m)(n+m)=2009=(1)(7)(7)(41)(2009)$ or
(ii) $(n-m)(n+m)=2010=(1)(2)(3)(5)(67)(2010)$ or
(iii) $(n-m)(n+m)=2011=(1)(2011)$.
From (i) we have the three possibilities $n-m=(1),n+m=(2009)$, $n-m=(41),n+m=(7)(7)$, $n-m=(7),n+m=(7)(41)$, with respective solutions $(n,m)=(1005,1004)$, $(n,m)=(45,4)$,$(n,m)=(147,140)$.There are no integer solutions for (ii) since the factorisation has either
$(n-m)$ even and $(n+m)$ odd, or vice versa, and in case (iii) we have $n-m=(1),n+m=(2011)$ with solution $(n,m)=(1006,1005)$. The set of all pairs of positive integers that satisfy $\left|n^2-m^2-2010\right|\le 1.$ is $\{(1005,1004),\, (45,4),\, (147,140),\, (1006,1005)\}.$