A simple modular arithmetic problem

When 5 5 50 5^{5^{50}} is divided by 117 117 , what remainder do we get?


The answer is 5.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Chew-Seong Cheong
Oct 13, 2020

Since gcd ( 5 , 177 ) = 1 \gcd(5,177) = 1 , we can use Euler's theorem . The Euler's totient function ϕ ( 117 ) = 117 × 2 3 × 12 13 = 72 \phi(117) = 117 \times \dfrac 23 \times \frac{12}{13} = 72 . Then we have:

5 5 50 5 5 20 m o d ϕ ( 117 ) (mod 117) 5 5 50 m o d 72 (mod 117) Again gcd ( 5 , 72 ) = 1 , Euler’s theorem applies. 5 5 50 m o d ϕ ( 72 ) m o d 72 (mod 117) and ϕ ( 72 ) = 72 × 1 2 × 2 3 = 24 5 5 50 m o d 24 m o d 72 (mod 117) 5 5 2 5 25 (mod 117) 5 × 12 5 8 (mod 117) 5 ( 117 + 8 ) 8 (mod 117) 5 ( 8 8 ) 5 ( 8 ) ( 12 8 3 ) (mod 117) 5 ( 8 ) ( 117 + 11 ) 3 5 ( 8 ) ( 1 1 3 ) (mod 117) 5 ( 8 ) ( 11 ) ( 121 ) 5 ( 8 ) ( 11 ) ( 4 ) (mod 117) 8 ( 220 ) 8 ( 14 ) (mod 117) 112 5 (mod 117) \begin{aligned} 5^{5^{50}} & \equiv 5^{5^{20} \bmod \phi(117)} \text{ (mod 117)} \\ & \equiv 5^{5^{50} \bmod 72} \text{ (mod 117)} & \small \blue{\text{Again }\gcd(5,72)=1 \text{, Euler's theorem applies.}} \\ & \equiv 5^{5^{50 \bmod \phi(72)} \bmod 72} \text{ (mod 117)} & \small \blue{\text{and }\phi(72) = 72 \times \frac 12 \times \frac 23 = 24} \\ & \equiv 5^{5^{50 \bmod 24} \bmod 72} \text{ (mod 117)} \\ & \equiv 5^{5^2} \equiv 5^{25} \text{ (mod 117)} \\ & \equiv 5 \times 125^8 \text{ (mod 117)} \\ & \equiv 5(117+8)^8 \text{ (mod 117)} \\ & \equiv 5 (8^8) \equiv 5(8)(128^3) \text{ (mod 117)} \\ & \equiv 5(8)(117+11)^3 \equiv 5(8)(11^3) \text{ (mod 117)} \\ & \equiv 5(8)(11)(121) \equiv 5(8)(11)(4) \text{ (mod 117)} \\ & \equiv 8(220) \equiv 8(-14) \text{ (mod 117)} \\ & \equiv -112 \equiv \boxed 5 \text{ (mod 117)} \end{aligned}

First of all, 117 117 is not prime. In fact, 117 = 3 2 × 13 117=3^2\times 13 .

We could use the Euler's Theorem to solve it.

The theorem says that given an integer n n , for any integer a a relatively prime to n n we have that a ϕ ( n ) 1 ( mod n ) a^{\phi(n)} \equiv 1 (\text{mod n}) , where ϕ ( n ) \phi(n) is the Euler's Totient Function .

We have that ϕ ( 117 ) = 117 ( 1 1 3 ) ( 1 1 13 ) = 72 \phi(117)=117\left(1-\frac{1}{3}\right)\left(1-\frac{1}{13}\right)=72 .

Then 5 72 1 ( mod 117 ) 5^{72} \equiv 1 (\text{mod 117}) , since gcd ( 5 , 117 ) = 1 \text{gcd}(5,117)=1 .

We can use the theorem again to find 5 50 ( mod 72 ) 5^{50} (\text{mod 72}) . This is important because a consequence of this theorem is that 5 5 to the power of any multiple of 72 72 will give us a remainder of 1 1 modulo 117 117 .

We have that 72 = 2 3 × 3 2 72=2^3\times 3^2 and then ϕ ( 72 ) = 72 ( 1 1 2 ) ( 1 1 3 ) = 24 \phi(72)=72\left(1-\frac{1}{2}\right)\left(1-\frac{1}{3}\right)=24 .

Then 5 24 1 ( mod 72 ) 5^{24} \equiv 1 (\text{mod 72}) , since gcd ( 5 , 72 ) = 1 \text{gcd}(5,72)=1 .

To find 5 50 ( mod 72 ) 5^{50} (\text{mod 72}) we could use the fact that 5 24 5 24 = 5 48 1 ( mod 72 ) 5^{24}\cdot 5^{24} = 5^{48}\equiv 1 (\text{mod 72}) .

Hence, 5 48 5 2 = 5 50 25 ( mod 72 ) 5^{48}\cdot 5^{2} = 5^{50}\equiv 25 (\text{mod 72}) .

It means that 5 50 25 5^{50}-25 is a multiple of 72 72 .

This gives us that 5 5 50 25 1 ( mod 117 ) 5^{5^{50}-25}\equiv 1 (\text{mod 117}) . Hence, 5 5 50 5 25 ( mod 117 ) 5^{5^{50}}\equiv 5^{25} (\text{mod 117}) .

We can easily find 5 25 ( mod 117 ) 5^{25} (\text{mod 117}) knowing that 5 72 5 3 = 5 75 = ( 5 25 ) 3 5 3 ( mod 117 ) 5^{72} \cdot 5^{3} = 5^{75} = \left(5^{25}\right)^{3} \equiv 5^{3} (\text{mod 117}) .

Finally, 5 25 5 ( mod 117 ) 5^{25} \equiv 5 (\text{mod 117}) .

In the end we have that 5 5 50 5 ( mod 117 ) 5^{5^{50}}\equiv 5 (\text{mod 117}) , and that is our answer.

If anyone has a simpler solution, I will appreciate to know!

You can use chinese remainder theorem too. 117 = 9 × 13 117 = 9 \times 13 .

Show that when 5 5 50 5^{5^{50}} is divided by 9 or 13, the remainder is both 5, and so the answer must be 5 as well.

Pi Han Goh - 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...