2

Prove that $\underbrace{2^{2^{2^{\cdot^{\cdot^{2}}}}}}_{2016 \mbox{ times}} \mod 9 = 7$

I think that it can be done by induction:

Base:
$2^{2^{2^{2}}} \equiv 2^{16} \equiv 2^8 \cdot 2^8 \equiv 2^4 \cdot 2^4 \cdot2^4 \cdot2^4 \equiv 7^2 \cdot 7^2 \equiv 4 \cdot 4 \equiv 16 \equiv 7$


Assume that it is true for $n$ times.
Let $a_n = \underbrace{2^{2^{2^{\cdot^{\cdot^{2}}}}}}_{n \mbox{ times}}$ $$ a_{n+1} = 2^{a_n} = 2^{9k+7} = 2^7 \cdot 2^{9k} \equiv 128 \cdot 1 \equiv 2 \neq 7 $$ Where did I go wrong?

Witalij
  • 63

3 Answers3

3

Just because we are working in modulo $9$, that doesn't mean that the exponents work in modulo $9$. In general, $2^{9k}\not\equiv 1$. Actually, if $k$ is odd, $2^{9k}\equiv -1$. Which is exactly what goes wrong here: You are getting $-7\equiv 2$, rather than $7$.

You can, of course, try to take this into account in your induction proof. But you run into the problem of trying to keep track of even and odd modulo $9$, which means that you've basically gone up to modulo $18$, and if we're unlucky (I don't think we are in this case), this will just explode.

We have $2^6 = 64\equiv 1$, so looking at the exponent modulo $6$ seems like it would be more natural than modulo $9$.

To help keeping things straight, I will introduce colours to our "power tower": $$ 2^{\displaystyle\color{red}2^{\displaystyle\color{blue}2^{\displaystyle\color{orange}2^{\cdot^{\cdot^2}}}}} $$ where the base is black, the first exponent is red, the seoncd is blue, the third is orange, and after that it turns out that we can stop caring.

Now, looking at the red number modulo $6$, we have $\color{red}2^\color{blue}{3} \equiv \color{red}2^\color{blue}{1}$ and $\color{red}2^\color{blue}{4}\equiv \color{red}2^\color{blue}{2}$, so looking at the blue number modulo $2$ seems like it could be useful (just as long as we make certain that it is strictly positive).

And we see that the blue number is strictly positive and even (it's a $2$ raised to the orange number, and the orange number is strictly positive). So it may as well be a $2$ as far as the red number is concerned. Which means that the red number might as well be a $4$ as far as the black number is concerned. Thus we end up with $2^\color{red}4\equiv 7$ modulo $9$ for our final answer.

Working this way, for each level you go up in the exponent tower, the modulus we are interested in will go down. Finally, at some stage (usually pretty quickly), we are basically just interested in whether the result of the remaining tower is even or odd (and possibly whether it's larger than some relatively small number), and then we can work our way down again.

Arthur
  • 199,419
  • $\color{indigo}{1}\color{red}{2}3\color{orange}{4}\color{blue}{5}6\color{green}{7}\color{yellow}{8}9$ –  May 14 '19 at 11:25
  • @RoddyMacPhee That's one idea, yes. I'll see what i can do. Just keep in mind that not everyone can see colour, so it won't be perfect either. – Arthur May 14 '19 at 11:26
  • yeah might use more fonts. it only colors in powers of two in order, red for 2, orange for 4, yellow for 8( aka -1 in this case), then 7(-2) gets green, 5(-4) gets blue, and 1(-8) gets indigo. –  May 14 '19 at 11:32
2

Where you fail, is in assuming exponents mod the modulus works. It wouldn't generally. the exponent is mod 6, when doing mod 9. So you get it equivalent to: $$128\cdot 2^{3k}=128\cdot8^k$$ Which then depends on parity of k (because 8's order mod 9 is 2).

  • at least not for power towers, there's a clunky way to do it with long division by the modulus, but it's not practical. –  Oct 28 '19 at 14:38
1

Apply modular order reduction using $\,\phi(9)=\color{#c00} 6\,$ i.e.

$\!\!\bmod 9\!:\,\ 2^{\Large\color{#c00} 6}\equiv 1\ \ {\rm thus}\ \ 2^{\large N}\equiv\, 2^{\large N\Large \bmod\, \color{#c00}6}\ $

$\text{Applying that here}\!:\ 2^{\Large {2^{\Large 2K}}}\!\!\equiv\, 2^{\Large \color{#0a0}{2^{\Large 2K}}\!\bmod\color{#c00} 6}\!\equiv 2^{\Large\color{#0a0} 4}\equiv 7$

$\text{since we have that:}$ $\bmod \color{#c00}6\!:\,\ \color{#0a0}{2^{\large 2K}}\!\equiv 4^{\large K}\!\equiv\color{#0a0} 4,\,$ by $\,4^{\large 2}\equiv 4\,$ and induction (or as here. $K\ge 1^{\phantom{|^|}}\Rightarrow 2^{2K}\!\bmod 6 = 2(\color{#0af}{2^{2K-1}}\!\bmod 3)\equiv 4,\,$ by $\!\bmod 3\!:\ \color{#0af}{2^{2K-1}}\!\equiv (-1)^{2K-1}\!\equiv -1\equiv \color{#0af}2)$.

Bill Dubuque
  • 272,048