<s>[INST] Find all 4 digits numbers that $ABCD=(CD)^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$.
 [/INST] 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$.


*

*For $D=0$ we need $2\cdot 0\cdot C\equiv C\pmod {10}$, so $C=0$.

*For $D=1$ we need $2\cdot 1\cdot C\equiv C\pmod {10}$, so $C=0$.

*For $D=5$ we need $2\cdot 5\cdot C+2\equiv C\pmod {10}$, so $C=2$

*For $D=6$ we need $2\cdot 6\cdot C+3\equiv C\pmod {10}$, so $C=7$


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.
</s>