The Question:
Evaluate $3^{123}\mod 100$
My Attempt
So initially I attempted to list the powers of 3 and find a pattern of the last two digits - which, despite much painful inspection did not yield an obvious useful pattern.
So I then attempted to simplify this and use Euler's Generalisation of Fermat's Theorem to solve this:
The theorem states: $a^{\phi(n)} \equiv 1 \pmod{n}$
So:
$3^{123}\mod 100$
= $3^{41^3}\mod 100$
= $(3^{40} \times 3^1)^3\mod 100$
I think I'm ok up to that point. Now, $\phi(100) = 40$
So am I right in the following?
$(3^{40} \times 3^1)^3\mod 100$ $\cong$ $(1 \times 3^1)^3\mod 100$
= $3^3\mod 100$
= 27.
Am I correct?
Thanks!
Correct! I believe your logic does hold correctly. As far as I can see this is a correct application of Euler's generalisation of Fermat's Theorem. $\phi(100) = 40$ and thus $3^{40} \cong 1 \mod 100$
If you need further convincing, simply input $3^{123}$ into https://www.calculatorsoup.com/calculators/algebra/large-exponent-calculator.php.
Again, not really needed, but if you needed concrete proof, there it is.