# Integers that squared have the same last two digits

I need to find the integers that when squared they maintain the las two digits, I've started like this: being b and a the last two digits of the number $(10b+a)²\equiv 10b+a \mod(100) \Rightarrow 20ab + a² \equiv 10b+a \mod(100)$ I don't know how to continue this, any idea?

• Hint: how many solutions are there to $n^2\equiv n\pmod {10}$? if $n$ is one of those...can you lift it to a solution of $n^2\equiv n\pmod {100}$ – lulu May 21 '16 at 19:38

HINT: Start by checking which digits $a$ can be; there are only four possibilities. Then substitute each of those possibilities into your congruence
$$20ab+a^2\equiv 10b+a\pmod{100}$$
and solve for $b$; note that there may be no solution in some cases.