2017年AMC10竞赛B第14题
2017 AMC10B P14  An integer $$N$$ is selected at random in the range $$1\leqslant N\leqslant2020$$. What is the probability that the remainder when $$N^{16}$$ is divided by $$5$$ is $$1$$?  在$1\leqslant N\leqslant2020$的范围内随机选择一个整数$N$。当$N^{16}$除以$5$时，余数是$1$的概率是多少？
美国AMC10/12->Knowledge Point->Combination->Probability Calculation->Geometric Models of Probabilities
By Fermat\textquotesingle s Little Theorem, $$N^{16}=\left( N^{4}\right)^{4}\equiv1$$(mod $$5$$), when $$N$$ is relatively prime to $$5$$. Hence, this happens with probability $$\frac 45$$.  Note that the patterns for the units digits repeat, so in a sense we only need to find the patterns for the digits $$0-9$$. The pattern for $$0$$ is $$0$$, no matter what power, so $$0$$ doesn\textquotesingle t work. Likewise, the pattern for $$5$$ is always $$5$$. Doing the same for the rest of the digits, we find that the units digits of $$1^{16}$$,$$2^{16}$$,$$3^{16}$$,$$4^{16}$$,$$6^{16}$$,$$7^{16}$$,$$8^{16}$$ and $$9^{16}$$ all have the remainder of $$1$$ when divided by $$5$$, so $$\frac 45$$.  We can use modular arithmetic for each residue of $$n$$ (mod $$5$$).  If $$n\equiv0$$ (mod $$5$$), then $$n^{16}\equiv0^{16}\equiv0$$(mod $$5$$),  If $$n\equiv1$$ (mod $$5$$), then $$n^{16}\equiv1^{16}\equiv0$$(mod $$5$$),  If $$n\equiv2$$ (mod $$5$$), then $$n^{16}\equiv\left( n^{2}\right)^{8}\equiv\left( 2^{2}\right)^{8}\equiv4^{8}\equiv\left( -1\right)^{8}\equiv1$$ (mod $$5$$).  If $$n\equiv3$$ (mod $$5$$), then $$n^{16}\equiv\left( n^{2}\right)^{8}\equiv\left( 3^{2}\right)^{8}\equiv9^{8}\equiv\left( -1\right)^{8}\equiv1$$ (mod $$5$$).  If $$n\equiv4$$ (mod $$5$$), then $$n^{16}\equiv4^{16}\equiv\left( -1\right)^{16}=1$$ (mod $$5$$).  In $$4$$ out of the $$5$$ cases, the result was $$1$$(mod $$5$$), and since each case occurs equally as $$2020\equiv0$$ (mod $$5$$), the answer is $$\frac 45$$. 