# Find all five digit number $\overline{abcde}$ such that $\overline{abcde} = \overline{(ace})^2$

Find all five digit number $$\overline{abcde}$$ such that $$\overline{abcde} = \overline{(ace})^2$$

This question popped in my mind while solving other elementary numbers and I have been trying to solve it ever since but without any luck.

My Take : Since the digit place of $$e^2$$ should be equal to digit's place of $$e$$ , So the only possible values of $$e$$ are $$0,1,5$$ and $$6$$

Also since the First digit of the numbers are equal , We can conclude that the the only possible values of $$a=1$$.

Hence our number can take the following form :

$$(1bcd0),(1bcd1),(1bcd5),(1bcd6)$$

But how do we further solve this?

Also Another interesting part of this question would be to solve for $$\overline{abcd}$$ such that $$\overline{abcd} = \overline{(bd)}^2$$

• Given that $a=1$, at worst you have to search the numbers from $100$ to $199$. Quite a lot fewer as the last digit is also constrained. – lulu Oct 5 '19 at 11:13
• You are right , but are there any more logical or mathematical ways to reduce the possibilities further? – The Demonix _ Hermit Oct 5 '19 at 11:18
• There only seem to be three cases. For example you can exclude anything above $100\sqrt{2}$ – Henry Oct 5 '19 at 11:19
• in fact lulu using PARI/GP you can show there are only 5 numbers in the whole of the three digit range, that have squares that leave 2 other digits to be $b$ and $d$ in any order. – user645636 Oct 5 '19 at 11:21
• As others have remarked, the search is really extremely narrow. This sort of problem often comes down to some case work. – lulu Oct 5 '19 at 11:23

We can minimize trial and error with some clever use of modular arithmetic.

Let $$N=100a+10c+e$$ be the square root. Thus $$N^2\equiv e^2$$ and we require also $$N^2\equiv e\bmod 10$$. Therefore $$e^2\equiv e$$ forcing $$e\in\{0,1,5,6\}$$.

We also know that $$(100a)^2<10000(a+1)$$ or $$a^2 forcing $$a=1$$. Then $$N^2<20000$$ but $$145^2>140×150=21000$$, therefore $$N<145$$. This result together with the earlier constraint on $$e$$ leaves only eighteen candidates, which can be exhaustively searched with little trouble; but we can do even better than that.

Consider the case $$e=0$$. Then $$N=100+10c$$ (with $$a=1$$) and $$N^2=10000+2000c+100c^2$$. For the hundreds digit in $$N^2$$ to match $$c$$ we must then have $$c^2\equiv c\bmod 10$$. This constraint admits$$c\in\{0,1,5,6\}$$, but only $$0$$ and $$1$$ satisfy the bounty $$N<145$$ which implies $$c\le 4$$. Thereby we identify

$$100^2=10000$$

$$110^2=12100$$

For $$e=1$$ we have

$$N^2=10000+2000c+100(c^2+2)+20c+1$$

With $$c\le 4$$, $$20c+1<100$$ and thus the hundreds digit is $$\equiv c^2+2\bmod 10$$. Therefore we must satisfy

$$c^2-c+2\equiv 0\bmod 10$$

which has a discriminant that is not a quadratic residue $$\bmod 5$$. So nobody's home here.

The cases $$e=5$$ and $$e=6$$ are left to the reader; they are handled similarly to $$e=1$$ as described above. For these cases $$N<145$$ implies $$c\le 3$$ which will then fix the hundreds digit as $$\equiv c^2+c$$ ($$e=5$$) or $$\equiv c^2+c+2$$ ($$e=6$$). We will then get only one additional solution which the reader can find. I list the complete solution set as (with $$x$$ digits to be filled in):

$$100^2=10000$$

$$1xx^2=1xxxx$$

$$110^2=12100$$