Euler's function and cyclicity What is the remainder when $17^{100000000\ldots}$, with $n$ zeroes is divided by $20$? I.e.:
$$
17^{10^n} \mod 20 = \ ?
$$
My approach: I can solve it by Euler's totient function ; $17^8=1 \mod 20$, so remainder is $1$.
But I want to know if the following method will fetch the result: $17$ divided by $20$ gives $-3$ as remainder and $-3$ raised to any multiple of $10 \mod 20$ gives $1$?
Is this logic correct? 
I think it works only for positive remainder.
 A: Modular arithmetic doesn't care about positive or negative. $17$ and $-3$ behave in exactly the same way modulo $20$. They are both representatives of the modulo 20 conjugacy class
$$
\{\ldots, -23, -3, 17, 37, \ldots\}
$$
and thus one might even say they are equal, under some interpretations of modular arithmetic (they are equal "in $\Bbb Z_{20}$", for those who know what that means). So yes, that would work.
Note that $(-3)^2 = 9 = 10-1$, so 
$$(-3)^4 = (10-1)^2 = 100-20+1\equiv 1\pmod{20}$$
is probably the fastest way to get to your answer.
A: Hint $\ \gcd(a,20)=1\,\Rightarrow\, \color{#c00}{x^{\large 4}\equiv 1}\pmod{20},\,$ being true mod $4$ and $5$.  
Thus if $\,f_n = a^{\large 10^{\Large n}}$ then $\bmod 20\!:\ \bbox[7px,border:1px solid #c00]{f_{n+1} \equiv {f_n}^{\large 2}}\ $ by $\, f_{n+1} = {f_n}^{10}\equiv \color{#c00}{({f_n}^{\large 2})^{\large 4}} {f_n}^{\large 2}\equiv {f_n}^{\large 2}$ 
So $\,\smash{\begin{array}{c | c } n & 0 & 1 & 2 & 3 & \cdots  \\ \hline f_n & a & a^2 & \color{#c00}1 & 1 &\cdots  \end{array}}\,$ by  $\, \bbox[3px,border:1px solid #c00]{\rm squaring}\,$ repeatedly.
A: Note that $10^n = 0$ mod $8$ for $n \geq 3$, so $10^n = 8m$ for some $m$. So $17^{10^n} = 17^{8m} = (17^8)^m$ which gives $1$ mod $20$.
