Finding the least significant digit of a large exponential. I am trying to find the least significant digit of $17^{{17}^{17}}$. I know that I need to use to use the properties of modular arithmetic and mod base 10, but I am not sure how to go about it. 
Please provide some hints/first few steps to help me get started.
 A: Start off by looking at $17^n$ mod 10. (In your case, n will end up being $17^{17}$, but that's way too big to calculate yet.)
$17^0$ ends in a $1$, $17^1$ ends in a $7$, $17^2$ is congruent to $7 \times 7$ so it ends in a $9$, $17^3$ likewise is congruent to $9 \times 7$ so it ends in a $3$, and finally $17^4$ is congruent to $3 \times 7$ so it ends in a $1$.
Since $17^0$ and $17^4$ are congruent mod 10, it follows that $17^n$ mod 10 will repeat every time the exponent $n$ goes up by 4.
Therefore, to solve your problem, you now need to calculate the exponent $17^{17}$ mod 4. Then you can use that along with the pattern I just described to get the final answer. Since this is homework, I'll let you calculate $17^{17}$ mod 4 yourself... hint, use the same idea that I used above!
A: We will use modular arithmetic, under the assumption that's what you are studying. One can also produce an almost equally short argument that doesn't use those tools.
(i) The number $17$ is odd, so 
$$17^{17^{17}}\equiv 1 \pmod{2}.$$ 
(ii) Now work modulo $5$. By Fermat's Theorem, $17^4\equiv 1 \pmod{5}$. So we want to compute $17^{17}$ modulo $4$. Since $17\equiv 1 \pmod 4$, we have $17^{17}\equiv 1 \pmod 4$. So 
$$17^{17^{17}}\equiv 2^1 \pmod 5.$$ 
From the results (i) and (ii), we can identify the last digit.
A: Hint What can you say about the powers of $17$ modulo 10?
A: Hint: For distinct primes $p, q,$ and any $a \neq 0
(\mod pq)$, use the formula: 
$$a^{(p-1)}(q-1) = 1 (\mod pq)$$
