# Find the remainder in the following case where there's a infinite power tower of $7$.

What is the remainder when $$7^{7^{7^{7^{.^{.^{.^{\infty}}}}}}}$$ is divided by 13?

I'm getting $6$. Is it correct?

-
And what does $7^{7^{7^{7^{.^{.^{.^{\infty}}}}}}}$ mean? – Zev Chonoles Jul 14 '12 at 6:57
How does your construction work? The sequence $7,7^7,7^{7^7},\dots$ is quite divergent. – J. M. Jul 14 '12 at 7:12

Note that $$7^{(7^k)}\equiv 6\bmod 13\iff 7^k\equiv 7\bmod 12\iff k\equiv 1\bmod 2$$ and that for any $n\geq 2$, $$7\uparrow\uparrow n=\underbrace{7^{7^{.^{.^{.^{7}}}}}}_{n\text{ 7's}}=7^{(7^{k})}$$ for some $k\equiv 1\bmod 2$ - specifically, $k=7\uparrow\uparrow (n-2)$. Here $\uparrow\uparrow$ is Knuth's up-arrow notation. Thus, for any $n\geq 2$, $$7\uparrow\uparrow n=\underbrace{7^{7^{.^{.^{.^{7}}}}}}_{n\text{ 7's}}\equiv 6\bmod 13,$$ which is what I assume you meant by your question; the notation $$7^{7^{7^{7^{.^{.^{.^{\infty}}}}}}}$$ does not make sense.

-

$(1+6r)^{1+2s}=1+(2s+1)(6r)+ \text{terms divisible by }6^2\equiv 7\pmod {12}$ for $odd\ r > 0$

So, $$7^{7^{7^{7^{.^{.^{.^{\infty}}}}}}}\equiv 7^{12s+7}$$ for some integer $s$.

Now, $7^{12s}\equiv 1 \pmod{13}$, as $7^{12}\equiv 1 \pmod{13}$ as $\phi(13)=12$

$\implies 7^{12s+7}\equiv 7^7\pmod{13}$

$\implies 7^{7^{7^{7^{.^{.^{.^{\infty}}}}}}}\equiv 7^7\pmod{13}≡-7≡6$

-