Sub topic 5
Unit Digit of Power Towers
A power tower has an exponent that is itself a power, such as
\[ 3^{(4^5)} \]
or, more generally,
\[ a^{(b^c)}. \]
This chapter assumes that you know place value, division with remainders, laws of exponents, and the unit-digit cycles of ordinary powers. The goal is to find the unit digit without evaluating the full tower.
The key idea: reduce the exponent
The unit digit of \(a^n\) depends only on \(a \bmod 10\). For most final digits, the powers repeat in a short cycle.
| Last digit of \(a\) | Cycle of unit digits | Cycle length |
|---|---|---|
| 2 | 2, 4, 8, 6 | 4 |
| 3 | 3, 9, 7, 1 | 4 |
| 4 | 4, 6 | 2 |
| 7 | 7, 9, 3, 1 | 4 |
| 8 | 8, 4, 2, 6 | 4 |
| 9 | 9, 1 | 2 |
The digits 0, 1, 5, and 6 repeat immediately. For example, every positive power of a number ending in 6 also ends in 6.
Suppose the cycle has length \(L\), and the exponent is \(E\). Find the remainder
\[ r=E\bmod L. \]
If \(r=0\), use the last position in the cycle. Otherwise, use position \(r\).
For a power tower \(a^{(b^c)}\), the difficult exponent is
\[ E=b^c. \]
You usually need only \(E\bmod L\), not the value of \(E\).
Worked example: \(3^{(4^5)}\)
The powers of 3 have unit-digit cycle
\[ 3,\ 9,\ 7,\ 1. \]
The cycle length is 4. We therefore need
\[ 4^5\bmod 4. \]
Because \(4^5\) is divisible by 4,
\[ 4^5\bmod 4=0. \]
A remainder of 0 means the fourth position in the cycle. The fourth digit is 1.
Therefore,
\[ \boxed{3^{(4^5)}\text{ has unit digit }1}. \]
# Unit digit of 3^(4^5)
# The cycle of powers of 3 is 3, 9, 7, 1.
print(pow(3, 4**5, 10)) # 1The three-argument form pow(a, n, m) calculates \(a^n\bmod m\) efficiently. It avoids constructing the enormous power itself.
A reliable procedure
For \(a^{(b^c)}\):
- Reduce \(a\) modulo 10.
- Write the unit-digit cycle for that final digit.
- Let \(L\) be the cycle length.
- Find \(b^c\bmod L\).
- Interpret remainder 0 as position \(L\).
- Read the corresponding digit from the cycle.
For example, consider \(7^{(12^{10})}\). The cycle of 7 is \(7,9,3,1\), so \(L=4\). Since \(12^{10}\) is divisible by 4, its remainder modulo 4 is 0. Use the fourth position, giving unit digit 1.
Taller towers
For a tower such as
\[ a^{(b^{(c^d)})}, \]
start from the outside. First identify the cycle length for \(a\). Then calculate the exponent \(b^{(c^d)}\) modulo that cycle length. If this exponent is still too large, apply the same idea again to the inner tower.
For CAT questions, check whether the required modulus is only 2 or 4. In many cases, divisibility makes the inner calculation immediate.
Exercise
Find the unit digit of 8^(3^4). The powers of 8 cycle as 8, 4, 2, 6.
Show answer
The cycle length is 4. Since 3^4 mod 4 = 1, use the first position of the cycle. The unit digit is 8.