Congruence Substitutions If I'm asked to calculate $319^{566} \pmod{23}$, and I know $319 \equiv 20 \pmod{23}$, is it mathematically correct to then calculate $20^{566}$ instead? I feel the answer is yes, but I've an exam tomorrow and would rather a concrete notion rather than an inclination. 
Thank you guys! 

The answer is yes ;here is the concrete explanation of this:-
$ $
we will use the Binomial Expansion of $(x+y)^n$
As we know that 
$$(x+y)^n=nC_0y^n+nC_1xy^{n-1}+......+nC_nx^n            \tag {1}   $$
Now we have $x=(319-20)i.e. 299$,which is divisible by $23$ and $y=20$, which is indivisible by $23$
In equation (1) all the terms of expansion except the $nC_0$ (first) term, are multiples of x i.e. of $299$ so we have to calculate the remainder of only first term i.e  $$(x+y)^n\pmod n=y^n{\pmod{23}} = 20^{566}\pmod{23}$$
