Find the smallest integer $n$ greater than $1$ such that the last $3$ digits of $n^2$ are the same as the last $3$ digits of $n$. Find the smallest integer $n$ greater than $1$ such that the last $3$ digits of $n^2$ are the same as the last $3$ digits of $n$.
So far I've got $n^2 = 1000k + n$ which means $n^2 ≡ n \mod 1000$. I  don't know how to proceed since 1000 seems to be a bit high.

Another way:
$(\pm1)^2\equiv1,(\pm2)^2\equiv4,(\pm3)^2\equiv9,(\pm4)^2\equiv6\pmod{10}$
The last digit of $n^2,n$ will be same if $n=10m,10m+1,10m+5,10m+6$
$(10m+6)^2\equiv36+20m\pmod{100}$
We need $10m+6\equiv36+20m\pmod{100}\iff10m\equiv-30\pmod{100}\iff m\equiv-3\pmod{10}$
WLOG $m=10r-3$
$10m+6=10(10r-3)+6=100r-24$
$(100r-24)^2\equiv576-4800r\pmod{1000}\equiv576+200r$
We need $100r-24\equiv576+200r\pmod{1000}\iff100r\equiv-600\equiv400\pmod{1000}\iff r\equiv4\pmod{10}$
$r=10s+4\implies100r-24=100(10s+4)-24=1000s+376$
Similarly for $10m+1,10m+5$
