I would like to calculate $ 2^{5^{77}}\bmod 113 $. I solved similar problems but with smaller exponent e.g. $ 2^{185}\bmod 113 $ with successive squaring method. Is there any way to use this method to solve it?
Asked
Active
Viewed 99 times
0
-
2$113$ is prime, so I would reduce $5^{77}$ modulo $112$ first – J. W. Tanner May 12 '20 at 19:52
-
@J.W.Tanner why I can do this? – kekereke May 12 '20 at 20:13
-
@JohnOmielan no – kekereke May 12 '20 at 20:13
-
1@kekereke Actually, the other question will help give you the answer once you use J.W.Tanner's suggestion, with it being useful since by Fermat's little theorem you have $2^{112} \equiv 1 \pmod{113}$. – John Omielan May 12 '20 at 20:18
-
@JohnOmielan Thanks. But what if it wasn't prime number? How can i deal with it? – kekereke May 12 '20 at 21:09
-
1@kekereke You're welcome. Note Fermat's little theorem is actually a special case (i.e., for primes only) of Euler's totient function, which deals with relatively prime numbers modulo $n$, even when $n$ itself is not prime. – John Omielan May 12 '20 at 21:12
-
to reduce $5^{77}$ modulo $112$, note that $5^{12}\equiv1\bmod112$ – J. W. Tanner May 13 '20 at 00:16
1 Answers
0
Rather than successive squaring, try successive raising to the $5^{th}$ power:
$2^{5^0}\equiv2\bmod 113$
$2^{5^1}\equiv32\bmod113$
$2^{5^2}\equiv32^5\equiv99\bmod113$
$2^{5^3}\equiv99^5\equiv56\bmod113$
$2^{5^4}\equiv56^5\equiv60\bmod113$
$2^{5^5}\equiv60^5\equiv105\bmod113$
$2^{5^6}\equiv105^5\equiv\color{red}2\bmod113$.
Can you take it from here? $\;$ Note that $77\equiv5\bmod6$.

J. W. Tanner
- 60,406