Please help me to solve following problem:
Find all 4 digits numbers such that $ABCD=(CD)^2$.(any of $A,B,C,D$ is a digit!)
I know one of solutions is $5776=(76)^2$.
Please help me to solve following problem:
Find all 4 digits numbers such that $ABCD=(CD)^2$.(any of $A,B,C,D$ is a digit!)
I know one of solutions is $5776=(76)^2$.
On
We need $D^2\equiv D\pmod{10}$ hence $D(D-1)$ must be a multiple of $10$. This implies that $D\in\{0,1,5,6\}$.
Next, the tens digit of $(CD)^2=(10\cdot C+D)^2=100\cdot C^2+20\cdot C\cdot D+D^2$ is determined by the ones digit of $2\cdot C\cdot D$ and the tens digit of $D^2$.
Thus the full list of answers is $$00^2=0000\quad 01^2=0001\quad 25^2=0625\quad 76^2=5776 $$ and possibly you won't count the first three as valid.
If you allow leading zeros, there are three more. $D$ must be $0,1,5,6$. You can then just try them all-there are only $40$ possibilities. As $0,1$ don't carry, in both cases we must have $C=0$. For $5$ it has to be $2$, giving $00,01,25,76$