Find the four digit number?

7.7k Views Asked by At

Find a four digit number which is an exact square such that the first two digits are the same and also its last two digits are also the same.

2

There are 2 best solutions below

5
On BEST ANSWER

HINT:

So, we have $$1000a+100a+10b+b=11(100a+b)$$

$\implies 100a+b$ must be divisible by $11\implies 11|(a+b)$ as $100\equiv1\pmod{99}$

As $0\le a,b\le 9, 0\le a+b\le 18\implies a+b=11$

$$\implies11(100a+b)=11(100a+11-a)=11^2(9a+1)$$

So, $9a+1$ must be perfect square

0
On

I recommend programming when numbers are so low.

Here is a Python solution:

>>> list(filter(lambda n: str(n**2)[0] == str(n**2)[1] and \
                          str(n**2)[-1] == str(n**2)[-2], 
                range(int(1000**0.5),int(10000**0.5))
               )
         )
[88]
>>> 88**2
7744

Note that I broke the line for easier readability.

So 7744 is the only solution.