## [Soln] 2014 Singapore MO (Open Rd 1) Problem 15

2014 SMO (Open-Rd1) 15. Find the largest even four-digit perfect square whose units digit exceeds the tens digit by 1 and whose thousands digit exceeds the hundreds digit by 1.

The smallest four-digit perfect square is $32^2 = 1024$ while the largest is $99^2 = 9801$. Hence, there are 99 – 32 + 1 = 68 cases to check in an exhaustive search. We can strike out about half of them since we are only looking for even perfect squares. So, if you are really desperate, exhaustive search may not be too bad an idea (and I would recommend starting from $98^2$ and working downwards since we are looking for the biggest one).

Let’s work out a better way. Let the perfect square be $n^2$. It is quite clear that $n$ must be a 2-digit number, so let $n = 10a + b$, where $a$ and $b$ each represent a digit from 0 to 9 (inclusive). Then,

$n^2 = (10a + b)^2 = \boldsymbol{100a^2 + 20ab + b^2}.$

Let’s worry about the condition concerning the thousands & hundreds digit later: conditions concerning the tens & ones digit are generally a lot easier to tackle. What can the expression above tell us about the ones and tens digit?

First, only the $b^2$ term contributes to the ones digit, hence the choice of $b$ completely determines the ones digit. Since $n^2$ must be even, we have 5 choices for $b$: 0, 2, 4, 6 and 8. However, the ones digit must be greater than 0 (why?), hence $b$ cannot be 0.

Next, the $20ab$ and $b^2$ terms both contribute to the tens digit. However, notice that the $20ab$ term always contributes an even number to the tens digit. Hence, in order for the tens digit to be one less than the ones digit, it must be odd and so the $b^2$ term must contribute an odd number to the tens digit. This rules out $b = 2$ and $b = 8$, so $b$ is either 4 or 6.

We have significantly reduced the number of cases! Now let’s go through each of them.

Case 1: b = 4.
Then,

$n^2 = 100a^2 + 80a + 16.$

In order for the tens digit to be 5, $a$ must be 3 or 8. However, $34^2 = 1156$ and $84^2 = 7056$ both do not satisfy the condition concerning the thousands and hundreds digit.

Case 2: b = 6.
Then,

$n^2 = 100a^2 + 120a + 36$.

In order for the tens digit to be 5, $a$ must be 1 or 6. $16^2 = 256$ is not even 4 digits, while $66^2 = 4356$ satisfies all the given conditions.

Hence, the answer is 4356. (In fact, it is the only 4-digit even perfect square to satisfy the given conditions.)