## 2014 Singapore MO (Junior Rd 1) Problem 28

2014 SMO (Junior-Rd1) 28. If both $n$ and $\sqrt{n^2 + 204n}$ are positive integers, find the maximum value of $n$.

The first step looks like we should assign some variable to $\sqrt{n^2 + 204n}$ and then square it in the hope of finding some relationship that constrains $n$. We have 2 choices: we can either set

$m = \sqrt{n^2 + 204n}$,

or since we know that $\sqrt{n^2 + 204n}$ must definitely be bigger than $n$, we could set

$n + k = \sqrt{n^2 + 204n}$,

where $k$ is some positive integer. Even though the 2nd option seems to incorporate more information, I don’t think that the 2nd option is always the best– sometimes the 1st option allows us to take advantage of some symmetry in the problem. One way to evaluate which option is better is to try both and see where each one leads after a few steps.

Squaring option 1, we get

\begin{aligned} &m^2 &&= n^2 + 204n, \\ &n^2 + 204n - m^2 &&= 0. \end{aligned}

We could treat the above as a quadratic equation in $n$ and say that the discriminant must be a perfect square, but the discriminant $204^2 - 4m^2$ seems quite large to work with.

Squaring option 2, we get

\begin{aligned} &(n + k)^2 &&= n^2 + 204n, \\ &2nk + k^2 &&= 204n, \\ &n &&= \frac{k^2}{204 - 2k}.\end{aligned}

This looks promising: since we are supposed to find the maximum value of $n$, we just have to maximise the fraction on the right.

When trying to maximise fractions, look at how the numerator and denominator respond to a change in the variables. If $k$ increases, does the numerator increase as well? How about the denominator? For this problem things seem to work out: when $k$ increases, the numerator grows larger and the denominator grows smaller, which means both numerator and denominator are working together to make the RHS bigger. Hence, we just need to find the largest possible value of $k$ to get the largest possible value of $n$.

Since $n$ is positive, the RHS must be positive too. The numerator is definitely positive, hence the denominator must be positive, i.e. $2k < 204$, or $k < 102$. $k$ can’t be 101 as it results in a value of $n$ that is not an integer. The next largest possible value for $k$ is 100, which results in

$n = \displaystyle\frac{100^2}{204 - 2(100)} = \frac{10,000}{4} = 2,500$.

A quick check shows that indeed, $n = 2500$ is valid:

$n^2 + 204n = 2,500^2 + 204 \cdot 2,500 = 6,760,000,$
$(n+k)^2 = (2,500 + 100)^2 = 6,760,000.$

Thus the maximum value for $n$ is 2,500.