Find four-digit numbers where the first two digits squared plus the last two digits squared gives back the same number.

number theory

If a four digit number $\overline{abcd} $ satisfies $\overline{abcd}=(\overline{ab})^2+(\overline{cd})^2$ where $a \neq 0.$ Find that number.

I think I have solved it (1233 and 8833). The way I did was kind of try and error. We have $ d \equiv b^2+d^2$ (mod 10). Then I listed all possible combinations of $b$ and $d$, and then just try and error on the value $a$ which also leads to the values of $c$. But I don't think if this is a smart/systematic method.

Best Answer

Let $x$ represent the first two digits and $y$ represent the second two digits. Thus

$100x+y=x^2+y^2$

$x(100-x)=y(y-1)$

The right side is even. Modulo $5$ the left side is $\in\{0,1,2\}$ and the right side is $\in\{0,1,4\}$. Thus both sides end with $0$ or $6$. In addition the left side must be $\in\{0,1\}\bmod3$ and the right side $\in\{0,2\}\bmod3$, so both sides are multiples of $3$.

So we need $x$ to be a multiple of $3$ or one more than such, $x(100-x)$ to end in $0$ or $6$ (forcing $x$ to end in one of the digits $0,2,8$), and $4[x(100-x)]+1=(2y-1)^2$ to be a perfect square. We set out to try eligible two-digit values of $x$ from $10$ up to $50$ (nine trials), knowing that any solution for $x$ in this range will be accompanied by a solution $100-x$ by symmetry of the product $x(100-x)$ on the left side. Blocks are cases where we do not get the needed perfect square for $4[x(100-x)]+1=(2y-1)^2$:

$x=10, x(100-x)=900, 4×900+1=3601■$

$x=12, x(100-x)=1056, 4×1056+1=4225=65^2☆$

$x=18, x(100-x)=1476, 4×1476+1=5905■$

$x=22, x(100-x)=1716, 4×1716+1=6865■$

$x=28, x(100-x)=2016, 4×2016+1=8065■$

$x=30, x(100-x)=2100, 4×2100+1=8401■$

$x=40, x(100-x)=2400, 4×2400+1=9601■$

$x=42, x(100-x)=2436, 4×2436+1=9745■$

$x=48, x(100-x)=2496, 4×2496+1=9985■$

So only $x=12$ works among numbers below $50$, from which $100-x=88$ will also work among numbers above $50$, and for this pair of solutions we see $2y-1=65, y=33$. Hence

$1233=12^2+33^2$

$8833=88^2+33^2$

Related Question