$$7^{3^{18}} \pmod{9}$$
Using this formula : $a^{\phi(m)} \equiv 1 \pmod m$
I got $7^6 \equiv 1 \pmod{9}$ and I can write $3^{18}$ as $3^6 \cdot 3^3$
And what are next steps? I got stuck here.
$$7^{3^{18}} \pmod{9}$$
Using this formula : $a^{\phi(m)} \equiv 1 \pmod m$
I got $7^6 \equiv 1 \pmod{9}$ and I can write $3^{18}$ as $3^6 \cdot 3^3$
And what are next steps? I got stuck here.
On
Without using Euler's Totient Theorem,
$7\equiv-2\pmod9\implies7^3\equiv(-2)^3\equiv1\pmod9$
Now $7^{3r}=(7^3)^r\equiv1^r\pmod9\equiv1$
Here $3r=3^{18}\iff r=3^{18-1}$
On
By Binomial theorem:
$$7^{3^{18}}\equiv (1+6)^{3^{18}}\equiv 1+\binom{3^{18}}{1}6\equiv 1\pmod{\! 9}$$
If $x$ and $a$ are co-prime, then: $$ a^{b^{c}} \equiv (a \mod x)^{(b^c \mod \phi(x))} \mod x$$ $$ \phi(9) = 6$$
$$ 7^{3^{18}} \equiv (7 \mod 9)^{(3^{18} \mod 6)} \mod 9$$ $$ 3^{18} = 9^{9} \equiv 3^{9} = 27^{3} \equiv 3^{3} \equiv 27 \mod 6 = 3 $$ $$ \equiv (7)^{3} \mod 9$$ $$ \equiv 21 \mod 9 $$ $$ \equiv 3 \mod 9 $$