We need to find the remainder when (2021)2023 is divided by 7.
Find 2021mod7.
2021=288×7+5
So 2021≡5(mod7)
Find the pattern of powers of 5 modulo 7.
51≡5(mod7)
52≡25≡4(mod7)
53≡20≡6(mod7)
54≡30≡2(mod7)
55≡10≡3(mod7)
56≡15≡1(mod7)
The powers of 5 repeat with a cycle of length 6 (by Fermat's Little Theorem).
Find 2023mod6.
2023=337×6+1
So 2023≡1(mod6)
Compute the remainder.
(2021)2023≡52023≡51≡5(mod7)
The remainder is 5.
The correct answer is Option D.