Digits in a perfect square problem

50 Views Asked by At

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.

2

There are 2 best solutions below

0
On BEST ANSWER

$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:

  • $b-a=1, b+a=1111$: $b=556, a=555$, but then $a^2=308025$ and is not a 4-digit number
  • $b-a=11, b+a=101$: $b=56, a=45$: $a^2=2025$ and $b^2=3136$ - a solution ($m=2025$)
0
On

\begin{eqnarray*} 1000a+100b+10c+d=x^2 \\ 1000(a+1)+100(b+1)+10(c+1)+(d+1)=y^2 \\ 1111 = y^2-x^2 \\ \color{blue}{11} \times \color{red}{101} = \color{blue}{(y-x)} \color{red}{(y+x)} \end{eqnarray*} Gives $x=45$ and $y=56$.