5. A positive integer $N$ and $N^{2}$ end with the same sequence of digits $\overline{a b c d}$, where $a-$ is a non-zero digit. Find $\overline{a b c}$.
Answer: 937.

Solution. Let's represent the number $N$ as $10000 M+k$, where $k$ and $M$ are natural numbers, and $1000 \leq k \leq 9999$. Since $N$ and $N^{2}$ end with the same sequence of digits, the difference

$$
N^{2}-N=\left(10^{4} M+k\right)^{2}-\left(10^{4} M+k\right)=10^{4}\left(10^{4} M^{2}+2 M k-M\right)+k^{2}-k
$$

ends with $\overline{0000}$. Thus, $k^{2}-k=k(k-1)$ is divisible by $10000=2^{4} \cdot 5^{4}$. At the same time, the numbers $k$ and $k-1$ are coprime. Therefore, there are four possible cases:

1) if $k$ is divisible by $10^{4}$, then $k=0$;
2) if $k-1$ is divisible by $10^{4}$, then $k=1$;
3) if $k$ is divisible by $5^{4}$ and $k-1$ is divisible by $2^{4}$, then $k=625$;
4) if $k$ is divisible by $2^{4}$ and $k-1$ is divisible by $5^{4}$, then $k-1=625 m$ ( $m$ is a natural number), and $625 m+1$ is divisible by 16. Since $625 \equiv 1(\bmod 16), 15 \cdot 625 \equiv 15(\bmod 16)$, and $15 \cdot 625+1=9376$ is divisible by 16, then $k=9376$.

Thus, $\frac{\text { First three digits }}{a b c}=937$.

Comment. It is proven that $N^{2}-N$ is divisible by $2^{4} \cdot 5^{4}-1$ point, it is noted that the numbers $k$ and $k-1$ (or $N$ and $N-1$) are coprime - 1 point, it is established that the numbers $k$ and $k-1$ cannot simultaneously contain factors 2 and $5-1$ point, the correct answer is found - 2 points, it is proven that there are no other possibilities - 2 points. Points are summed up.