# How do we solve for a

$a = (5^4\ (\text{mod}\ 7))^3\ (\text{mod}\ 13)$

I know that I have to evaluate $5^4\ (\text{mod}\ 7)$ first, but how do you do that without using a calc?

then I have to evaluate $x^3\ (\text{mod}\ 13)$. Any tip?

-

$$5^4=25\cdot 25\equiv 4\cdot 4 \equiv 2 \quad(\text{mod}\,7)$$

$$2^3 = 8 \equiv 8 \quad(\text{mod}\,13)$$

-

Multiply in your head. Faster and safer than a calculator. No rummaging for the calculator, no dead battery, no keying errors.

Recall that $5^2=25$, remainder $4$ on division by $7$. Square again (that is, square $4$), take the remainder on division by $7$. We get $2$. Cube $2$.

-