TITLE: Math Olympiad Algebraic Question
QUESTION [7 upvotes]: If both $n$ and $ \sqrt{n^2+204n} $ are positive integers, find the maximum value of $n$.

I came across this question during a Math Olympiad Competition. I need help with solving the question. Thanks.

REPLY [6 votes]: there must be some natural $k$ s.t. $n^2 + 204n = (n+k)^2$. easy to see the bigger the $k$ the bigger the $n$ because it's equivalent to $$ (204-2k)n = k^2$$ then again there's an easy bound on $k$ since
$$n^2 + 204n < (n+102)^2$$  hence we can just try a couple of possibilities. if you write
$$n^2 + 204n = (n+101)^2$$ then it won't give any solutions, since it boils down to $2n = 101^2$
on the other hand trying $$n^2 +204n = (n+100)^2$$ gives a solution $n=2500$ and we're done