3

I understand how to do modular arithmetic on numbers with large exponents (like $8^{202}$). However, I am having trouble understanding how to calculate something like:

$ 3^{3^{3^{3^3}}}$ mod 5

(that's 5 3's there). Can anyone help me understand how to get this started?

2 Answers2

0

By Fermat's Little Theorem, it suffices to look at the exponent modulo 4, so the problem reduces to finding $3^{3^{3^3}}$ modulo 4. But $3^{3^{3^3}} \equiv (-1)^{(-1)^{3^3}} \equiv (-1)^{-1} \equiv -1 \pmod 4$.

Thus $3^{3^{3^{3^3}}} \equiv 3^{-1} \equiv 2 \pmod 5$.


Edit: Fermat's Little Theorem tells us that for any prime $p$, we have $a^{p-1} \equiv 1 \pmod p$ for all $a \not \equiv 0 \pmod p$. So, in particular, $a^4 \equiv 1 \pmod 5$ provided $a \not \equiv 0 \pmod 5$, which is why we can reduce the exponent modulo 4.

Théophile
  • 24,627
  • Could you add a bit more information? I thought Fermat's Little Theorem was used for something completely different. – WinterStar Feb 23 '15 at 04:55
  • @WinterStar My comment to your question shows exactly how it should be used for this problem. It works very well for reducing the exponent of a number if the number is coprime to the prime modulus (it is coprime to the prime modulus iff it is not divisible by $p$). – user26486 Feb 23 '15 at 04:58
  • ... look at the exponent mod $4$, not mod $5.\ \ $ – Bill Dubuque Feb 23 '15 at 05:12
  • @BillDubuque Thanks for catching that; I fixed it. – Théophile Feb 23 '15 at 18:45
  • @WinterStar I added a brief explanation on FLT. – Théophile Feb 25 '15 at 03:48
  • Can you please show how $ 3^{-1} \equiv 2 \pmod 5$ – saner Dec 18 '21 at 20:46
  • @ErikMartinesSanches Since $3\cdot2 = 6 \equiv 1 \pmod 5$, it follows that the inverse of $3$ is $2$. Compare this to normal arithmetic, where $3\cdot\frac13 = 1$, and in that case $3^{-1} = \frac13$. – Théophile Dec 19 '21 at 00:25
-1

When dealing with tetration, numbers really go out of hand... I've never seen modular arithmetic operated on tetrated numbers..

$$3\uparrow\uparrow1 = 3^1$$ mod 5 on this yields 3 $$3\uparrow\uparrow2 = 3^3$$ mod 5 on this yields a 2 $$3\uparrow\uparrow3 = 3^{(3^3)} = 3^{27}$$ mod 5 on this (Online calc) yields a two as well. Problem is, calculators (Atleast the ones available online), aren't able to calculate after this.

You're asking $$(3\uparrow\uparrow5) mod (5) = 3^{3^{3^{3^3}}} mod (5) $$ This may be of interest...https://zbmath.org/?q=an:0535.03018&format=complete http://www.sciencedirect.com/science/article/pii/0898122183901141

You can also look at http://en.wikipedia.org/wiki/Euler%27s_totient_function; http://math.eretrandre.org/tetrationforum/showthread.php?tid=45 for some ideas.

I'm not much into Mod arithmetic; but the two articles I've provided may be of some help, as they directly deal with your doubts...

PS: Good question! Definite thumbs up.