Last Two Digits of Power Towers 13^(13^13) + 17^(17^17)

Board: Olympiad | Grade: Olympiad | Chapter: Modular Arithmetic

Problem

Find the last two digits (i.e., the remainder upon division by $100$) of the sum $$S = 13^{13^{13}} + 17^{17^{17}}.$$

Step-by-Step Textbook Solution

To find $S \pmod{100}$, we evaluate each term separately using Euler's Totient Theorem.

Since $\gcd(13, 100) = \gcd(17, 100) = 1$ and $\varphi(100) = 100\left(1-\frac{1}{2}\right)\left(1-\frac{1}{5}\right) = 40$, Euler's theorem guarantees $a^{40} \equiv 1 \pmod{100}$ for $\gcd(a, 100) = 1$. In fact, we can check the exact multiplicative order modulo $100$ (note $\lambda(100) = \operatorname{lcm}(\varphi(4), \varphi(25)) = \operatorname{lcm}(2, 20) = 20$):

  • For $13$: $13^2 = 169 \equiv 69$, $13^4 \equiv 69^2 = 4761 \equiv 61$, $13^8 \equiv 61^2 = 3721 \equiv 21$, $13^{10} \equiv 21 \cdot 69 = 1449 \equiv 49$, and $13^{20} \equiv 49^2 = 2401 \equiv 1 \pmod{100}$.
  • For $17$: $17^2 = 289 \equiv -11$, $17^4 \equiv 121 \equiv 21$, $17^8 \equiv 441 \equiv 41$, $17^{16} \equiv 1681 \equiv 81$, and $17^{20} \equiv 81 \cdot 21 = 1701 \equiv 1 \pmod{100}$.

Thus we only need the exponents $13^{13}$ and $17^{17}$ modulo $20$.

  1. For $13^{13} \pmod{20}$: $\varphi(20) = 8$, and in fact $13^2 = 169 \equiv 9 \pmod{20}$ and $13^4 \equiv 81 \equiv 1 \pmod{20}$. Since $13 \equiv 1 \pmod 4$, $$13^{13} \equiv 13^1 \equiv 13 \pmod{20}.$$ Hence $$13^{13^{13}} \equiv 13^{13} = 13^8 \cdot 13^4 \cdot 13 \equiv 21 \cdot 61 \cdot 13 \equiv 81 \cdot 13 = 1053 \equiv 53 \pmod{100}.$$

  2. For $17^{17} \pmod{20}$: $17 \equiv -3 \pmod{20}$, and $(-3)^4 = 81 \equiv 1 \pmod{20}$. Since $17 \equiv 1 \pmod 4$, $$17^{17} \equiv 17^1 \equiv 17 \pmod{20}.$$ Hence $$17^{17^{17}} \equiv 17^{17} = 17^{16} \cdot 17 \equiv 81 \cdot 17 = 1377 \equiv 77 \pmod{100}.$$

Adding the two remainders modulo $100$: $$S \equiv 53 + 77 = 130 \equiv 30 \pmod{100}.$$ Therefore, the last two digits of $S$ are $30$.

NityaDhi Solution (Intuitive Method)

Use Carmichael's $\lambda$-function and mod-4/25 splitting:

  1. Modulo $4$, $13 \equiv 1 \pmod 4$ and $17 \equiv 1 \pmod 4$, so $13^{13^{13}} + 17^{17^{17}} \equiv 1 + 1 = 2 \pmod 4$.
  2. Modulo $25$, $\varphi(25) = 20$. Since $13^4 \equiv (-3)^4 \equiv 1 \pmod{20}$ and $17^4 \equiv (-3)^4 \equiv 1 \pmod{20}$, both top exponents satisfy $a^a \equiv a^1 = a \pmod{20}$.
  3. Notice $(13)^{13}$ and $(17)^{17}$ mod $25$:
    • $13^2 = 169 \equiv -6 \pmod{25} \implies 13^{12} \equiv (-6)^6 = 36^3 \equiv 11^3 = 1331 \equiv 6 \pmod{25}$, wait: even faster, $(-6)^2 = 36 \equiv 11$, $11^3 \equiv 6$, wait $6 \times 13 = 78 \equiv 3 \pmod{25}$! Since $53 \equiv 3 \pmod{25}$ and $53 \equiv 1 \pmod 4$, $13^{13} \equiv 53 \pmod{100}$.
    • $17^2 = 289 \equiv 14 \equiv -11 \pmod{25}$, $17^4 \equiv 121 \equiv -4$, $17^{16} \equiv (-4)^4 = 256 \equiv 6 \pmod{25}$, so $17^{17} \equiv 6 \cdot 17 = 102 \equiv 2 \pmod{25}$! Since $77 \equiv 2 \pmod{25}$ and $77 \equiv 1 \pmod 4$, $17^{17} \equiv 77 \pmod{100}$.
  4. Sum mod $25$ is $3 + 2 = 5$, and sum mod $4$ is $2$. The unique number in $[0,99]$ that is $5 \pmod{25}$ and $2 \pmod 4$ is $30$.

Common Mistakes to Avoid

  • Using $\varphi(100)=40$ carelessly on the second level: Students reduce $13^{13} \pmod{40}$ instead of $\pmod{20}$ (which works, though slower), or worse, reduce $13^{13} \pmod{100}$ directly—which is completely invalid because exponents reduce modulo $\varphi(100)$, not modulo $100$.
  • Assuming $a^b \equiv (a \bmod 40)^b$ works for the base of the tower: Reducing the base of the exponent tower modulo $40$ is valid, so $13^{13} \pmod{40}$ works, but reducing the exponent $13$ modulo $40$ does nothing without $\varphi(40)=16$ (or $\text{ord}_{40}(13)=4$).