Basic Modulo Question I've been having trouble with this example while studying for my exams. Why is 
$$2023^{2297}\equiv 20 \pmod{3953}\;?$$ 
Thanks so much for any help I can get!
The examples solves the answer by using $2297 = 2^{11} + 2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^0$

The point of the example is to show the use of repeated squaring.  Once you write $2297 = 2^{11} + 2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^0$ you can do $x^{2297}=x^{(2^{11} + 2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^0)}=x^{2^{11}}x^{2^7}x^{2^6}x^{2^5}x^{2^4}x^{2^3}x^{2^2}x$ and you can get each of the last terms by squaring $x \ 11$ times, taking it $\pmod {3957}$ each time.  Then you can multiply two of them, take it $\pmod {3957}$, multiply by the next, take it $\pmod {3957}$, and so on.  You never need numbers of more than eight digits this way.
