Fermat Theorem : Application in finding remainders

Fermat theorem states that for any two positive natural numbers N and P, if they are co-prime to each other then remainder obtained when ${N^{\phi \left( P \right)}}$is divided by P is 1, where $\phi \left( P \right)$ is the euler of P. i.e. $\frac{{{N^{\phi \left( P \right)}}}}{P} \to R\left( 1 \right)$ Example 1:Find the …