Modular Exponentiation 3^5^7

177 Views Asked by At

I am trying to find the last digit of $3^{5^7}$ (or $3^{(5^7)}$, if you will) using modular exponentiation. Here's what I've figured out:

The value I want is $3^{5^7} \mod 10$.

$5^n \mod 10 = 5$ (if $n$ is a positive natural number).

The residues of $3^n \mod 10$ repeat themselves every time $n$ increases by $4$. The pattern is $1, 3, 9, 7, 1, 3, 9, 7, \ldots$ for $n = 0, 1, 2, 3, 4, 5, 6, 7, \ldots$

Now, I don't know how to use these facts to get what I need. I know that the answer $3$ (via WolframAlpha) but I don't know how to connect the dots here. Any help would be appreciated.

Thanks!

3

There are 3 best solutions below

0
On BEST ANSWER

You noticed that $3^n \equiv 3^m \pmod{10}$ if $n \equiv m \pmod{4}$. How about computing $5^7 \pmod 4$? If you can reduce $5^7 \equiv k \pmod 4$ for some $k \in \{0,1,2,3\}$, then $3^{(5^7)} \equiv 3^k \pmod{10}$ and you have your answer. I will leave you the pleasure of computing since you seem able to do so.

Hope that helps,

0
On

Hint $\,\ \color{#0a0}{3^{\large 5}\equiv 3}\ \Rightarrow\ 3^{\large 5^{\Large \color{#c00}{N+1}}}\! \equiv (\color{#0a0}{3^{\large 5}})^{\large 5^{\Large N}}\!\equiv\, \color{#0a0}3^{\large 5^{\Large \color{#c00}N}}\,$ so $\ 3^{\large 5^{\Large \color{}{N}}}\! \equiv 3\ $ by induction,

i.e. fixed points stay fixed on iteration $\ f(a) = a\,\Rightarrow\, f^N(a) = a.\ $ Above $\,f(a) = a^5.$

0
On

For $(a,m)=1,$ we have $$a^n\equiv a^{n\pmod{\phi(m)}}\pmod m$$

As $\phi(10)=4,(3,10)=1$

$$3^{5^7}\equiv3^{5^7\pmod4}\pmod{10}$$

Now $5\equiv1\pmod4\implies5^7\equiv1^7\equiv1$