Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
up vote 3 down vote accepted

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!

share|cite|improve this answer

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.

share|cite|improve this answer

Hint What can you say about the powers of $17$ modulo 10?

share|cite|improve this answer

Hint: For distinct primes $p, q,$ and any $a \neq 0 (\mod pq)$, use the formula: $$a^{(p-1)}(q-1) = 1 (\mod pq)$$

share|cite|improve this answer
Your response was a bit unclear as I edited it; please further my edits to ensure accuracy. (Note: I did not downvote your response) – daOnlyBG Oct 9 '15 at 19:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.