The remainder when 2021 divided by 7 is −2. Hence, the problem reduces to finding the remainder when (−2)2023 is divided by 7.
=7(−2)2022×(−2)
=−72×22022
=7−2×(23)674
=7−2×(8)674
=7−2×(1+7)674
Using binomial theorem, we get
=7−2×(1+7k) where k is an integer.
=7−2−14k
Clearly, the remainder when −14k is divisible by 7 is 0.
=7−2
=7−2−5+5=75
Hence, the remainder is 5.