Computing last two digits of $27^{2018}$

abstract-algebramodular arithmetictotient-function

For abstract algebra I have to find the last two digits of $27^{2018}$, without the use of a calculator, and as a hint it says you should work in $\mathbb{Z}/100\mathbb{Z}$.

I thought breaking up the problem into $\mod(100)$ arguments. Thus:
$27^{2}=729\equiv 29 \mod (100)$, and

$27^{4}=(27^{2})^{2} \equiv 29^{2}=861\equiv 61 \mod (100)$ and

$27^{8}=(27^{4})^{2} \equiv 61^{2}=3421 \equiv 21 \mod(100)$ and so on until I would find something that repeated itself. But I've done quite some terms no and I've not seen any iteration yet. So I'm thinking this is the wrong way.

Any suggestions?

Best Answer

$\phi(100)=40$, so we can reduce the exponent mod $40$: $$ 27^{2018}\equiv27^{18}\pmod{100} $$ Then we can square and multiply: $$ \begin{align} 27^2&\equiv29\\ 27^4&\equiv41\\ 27^8&\equiv81\\ 27^9&\equiv87\\ 27^{18}&\equiv69\pmod{100} \end{align} $$

Related Question