We have $12^{12^{12}} \pmod{13}$. I tried solving it this way.
$12^{12^{12}} \equiv -1^{-1^{-1}} \pmod{13} = -1^{\frac{1}{-1}} = \frac{1}{-1} = -1$. But the correct answer is 1, why?
We have $12^{12^{12}} \pmod{13}$. I tried solving it this way.
$12^{12^{12}} \equiv -1^{-1^{-1}} \pmod{13} = -1^{\frac{1}{-1}} = \frac{1}{-1} = -1$. But the correct answer is 1, why?
Since $12\equiv -1 \bmod 13$, for any odd exponent $12^{2n+1} \equiv -1 \bmod 13$ and for any even exponent $12^{2n} \equiv 1 \bmod 13$. You just have to see that the exponent in your expression must be even and you are done.