I want to calculate:
$2^{33} \mod 25$
Therefore I calculate first the Euler's phi function of 25:
$\phi(25) = 5^{2-1} (5-1)$ = 20
Now I can continue with Fermat's little problem:
$2^{33} \mod 25$ = $(2^{20} * 2^{13}) \mod 25 \equiv 2^{13} \mod 25$
How can I proceed to simplify the result? I tried the following 2 approaches and I'm not sure what kind of operations are allowed and which are not. In both ways, I'll get the same result but it is wrong:
1. Approach
$2^{13} \mod 25 \equiv ((2^5 \mod 25)^2 * 2^3) \mod 25 \equiv$
$\equiv ((7^2 \mod 25) * (2^3 \mod 25)) \mod 25 \equiv 24 * 7 \mod 25 \equiv$
$\equiv 168 \mod 25 = 18$
2. Approach
$2^{13} \mod 25 \equiv ((2^5 \mod 25)^2 * 2^3) \mod 25 \equiv$
$\equiv 7^2 * 2^3 \mod 25 \equiv 1568 \mod 25 = 18$