Let $m$ be a perfect square of 4 digits, with the digits $\lt 9$. Adding $1$ to each of the digits of $m$ will form another perfect square. Find $m$.
To be honest i'm absolutely lost, i tried with brute force but for this kind of problem i like to get the "elegant" way to solve it.
$m=a^2$ and $m+1111=b^2$, so $b^2-a^2=(b-a)(b+a)=1111=11\cdot 101$ where $11$ and $101$ are prime. Thus, there are two solutions for $b-a$ and $b+a$ that we need to try: