21. Find the remainder when $1021^{1022}$ is divided by 1023 .
21. Answer: 4 .
Note that $1024=2^{10} \equiv 1(\bmod 1023)$. Then
$$
1021^{1022} \equiv(-2)^{1022} \equiv 2^{1022} \equiv 2^{10 \times 102+2} \equiv 1024^{102} \times 2^{2} \equiv 1^{102} \times 2^{2} \equiv 4 \quad(\bmod 1023)
$$