Advanced Modular Arithmetic #2

N = 200 4 200 3 200 2 200 1 200 0 199 9 \large N=2004^{2003^{2002^{2001^{2000^{1999^{\cdots}}}}}}

What is the remainder when N N is divided by 1000?


The answer is 704.

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.

3 solutions

Boi (보이)
Jun 16, 2017

We are going to prove some facts before we start figuring out the answer.


Fact 1.

Know that 2 11 = 2048 2^{11}=2048 and 2 3 = 8 2^3=8 .

Divide each of them by 40 40 and you'll see they have the same remainder.

So we can say that 2 11 2 3 ( m o d 40 ) 2^{11}\equiv2^3 \pmod {40} .

Then, for positive integer n n and p 3 p\geq3 ,

2 8 n + p 2 p ( m o d 40 ) \boxed{2^{8n+p}\equiv2^p \pmod{40}}


Fact 2.

Know that 3 5 = 243 7 ( m o d 50 ) 3^5=243\equiv-7\pmod{50} .

Then you'll see 3 10 = ( 3 5 ) 2 7 2 1 ( m o d 50 ) 3^{10}=(3^5)^2\equiv7^2\equiv-1\pmod{50} .

Therefore, for positive integer n n ,

3 10 n ( 1 ) n ( m o d 50 ) \boxed{3^{10n}\equiv(-1)^n\pmod{50}}


Fact 3.

Know that 7 6 2 = 5776 776 ( m o d 1000 ) 76^2=5776\equiv776\pmod{1000} .

Then you'll see 57 6 2 = 50 0 2 + 2 × 500 × 76 + 7 6 2 7 6 2 776 ( m o d 1000 ) 576^2=500^2+2\times500\times76+76^2\equiv76^2\equiv776\pmod{1000} .

57 6 3 = 57 6 2 × 576 776 × 576 700 × 500 + ( 1000 + 200 ) × 76 + 7 6 2 200 + 776 976 ( m o d 1000 ) 576^3=576^2\times576\equiv776\times576\equiv700\times500+(1000+200)\times76+76^2\equiv200+776\equiv976\pmod{1000}

Similarly,

57 6 4 176 ( m o d 1000 ) 576^4\equiv176\pmod{1000}

57 6 5 376 ( m o d 1000 ) 576^5\equiv376\pmod{1000} .

Also, see that 37 6 2 = 300 × 300 + 2 × 300 × 76 + 7 6 2 600 + 776 376 ( m o d 1000 ) 376^2=300\times300+2\times300\times76+76^2\equiv600+776\equiv376\pmod{1000} .

Now, we can infer that 37 6 n 376 ( m o d 1000 ) 376^n\equiv376\pmod{1000} .

Therefore, 57 6 5 n + 4 = ( 57 6 5 ) n × 57 6 4 37 6 n × 176 376 × 176 176 ( m o d 1000 ) 576^{5n+4}=(576^5)^n\times576^4\equiv376^n\times176\equiv376\times176\equiv176\pmod{1000} .

We can see that 4 10 = 2 20 = ( 2 10 ) 2 = 2 4 2 = 576 ( m o d 1000 ) 4^{10}=2^{20}=(2^{10})^2=24^2=576\pmod{1000} .

Therefore, for positive integer n n ,

4 50 n + 40 176 ( m o d 1000 ) \boxed{4^{50n+40}\equiv176\pmod{1000}}


Now let's figure out the answer.

Firstly, note that 200 1 200 0 199 9 1 ( m o d 8 ) 2001^{2000^{1999^{\cdots}}}\equiv1\pmod{8} .

Then for a positive number k k , using Fact 1 ,

200 2 200 1 200 0 = 200 2 8 k + 1 2 8 ( k 1 ) + 9 2 9 32 ( m o d 40 ) 2002^{2001^{2000^{\cdots}}}=2002^{8k+1}\equiv2^{8(k-1)+9}\equiv2^9\equiv32\pmod{40} .

.

Then for a positive number m m , using Fact 2 ,

200 3 200 2 200 1 3 40 m + 32 ( 3 10 ) 4 m + 3 × 3 2 ( 1 ) 4 m + 3 × 9 9 41 ( m o d 50 ) 2003^{2002^{2001^{\cdots}}}\equiv3^{40m+32}\equiv(3^{10})^{4m+3}\times3^2\equiv(-1)^{4m+3}\times9\equiv-9\equiv41\pmod{50} .

.

Then, for a positive number n n , using Fact 3 ,

200 4 200 3 200 2 4 50 n + 41 4 50 n + 40 × 4 176 × 4 704 ( m o d 1000 ) 2004^{2003^{2002^{\cdots}}}\equiv4^{50n+41}\equiv4^{50n+40}\times4\equiv176\times4\equiv704\pmod{1000} .

Therefore, N 704 ( m o d 1000 ) \boxed{N\equiv704\pmod{1000}} .

How could you think about that way?? Too genius! I only use Euler Totient function to do it.

Kelvin Hong - 3 years, 11 months ago
Kelvin Hong
Jun 25, 2017

Although @H.M. 유 's solution is faster, I would like to elaborate my solution, by using Euler Totient function here.

We have

N 4 200 3 200 2 . . . ( m o d 1000 ) N\equiv 4^{2003^{2002^{...}}} (mod 1000)

Because g c d ( 4 , 1000 ) 1 gcd(4,1000) \neq 1 , so we separate it to

{ N 0 ( m o d 8 ) N 4 n 1 ϕ ( 125 ) + r 1 ( m o d 125 ) \begin{cases} N\equiv 0 (mod 8)\\ N\equiv 4^{n_1 \phi(125) +r_1} (mod 125)\\ \end{cases}

which n i n_i and r i r_i are positive integer.

So ϕ ( 125 ) = 100 \phi(125)=100 , we get

N 4 100 n 1 + r 1 ( m o d 125 ) N\equiv 4^{100n_1 +r_1} (mod 125)

Then

200 3 200 2 200 1 . . . = 100 n 1 + r 1 2003^{2002^{2001^{...}}}=100n_1+r_1

r 1 3 200 2 200 1 . . . 3 n 2 ϕ ( 100 ) + r 2 3 40 n 2 + r 2 ( m o d 100 ) r_1\equiv 3^{2002^{2001^{...}}}\equiv 3^{n_2 \phi(100) +r_2} \equiv 3^{40n_2 +r_2}(mod100)

r 2 200 2 200 1 200 0 . . . 2 200 1 200 0 . . . ( m o d 40 ) r_2\equiv 2002^{2001^{2000^{...}}}\equiv 2^{2001^{2000^{...}}} (mod 40)

Again, since g c d ( 2 , 40 ) 1 gcd(2,40)\neq 1 , separate it to

{ r 2 0 ( m o d 8 ) r 2 200 2 200 1 200 0 . . . 2 200 1 200 0 . . . 2 4 n 3 + r 3 ( m o d 5 ) \begin{cases} r_2\equiv 0 (mod 8)\\ r_2\equiv 2002^{2001^{2000^{...}}}\equiv 2^{2001^{2000^{...}}}\equiv 2^{4n_3+r_3}(mod 5)\\ \end{cases}

Last step of this, we knew that ϕ ( 5 ) = 4 \phi(5)=4 and 200 1 200 0 199 9 . . . 1 ( m o d 4 ) 2001^{2000^{1999^{...}}}\equiv 1 (mod 4)

It leads to,

{ r 2 0 ( m o d 8 ) r 2 2 ( m o d 5 ) \begin{cases} r_2\equiv 0 (mod 8)\\ r_2\equiv 2(mod 5)\\ \end{cases}

Then by Chinese Remainder Theorem , it gives us r 2 32 ( m o d 40 ) r_2 \equiv 32 (mod 40)

Then r 1 3 32 8 1 8 ( 19 ) 8 1 9 8 36 1 4 6 1 4 3 9 4 152 1 2 2 1 2 441 41 ( m o d 100 ) r_1\equiv 3^{32}\equiv 81^8 \equiv (-19)^8\equiv 19^8 \equiv 361^4 \equiv 61^4 \equiv 39^4\equiv 1521^2 \equiv 21^2\equiv 441\equiv 41 (mod 100)

Recall that

{ N 0 ( m o d 8 ) N 4 n 1 ϕ ( 125 ) + r 1 ( m o d 125 ) \begin{cases} N\equiv 0 (mod 8)\\ N\equiv 4^{n_1 \phi(125) +r_1} (mod 125)\\ \end{cases}

By solving the second case of that, we have

{ N 0 ( m o d 8 ) N 79 ( m o d 125 ) \begin{cases} N\equiv 0 (mod 8)\\ N\equiv 79 (mod 125)\\ \end{cases}

Using Chinese Remainder Theorem again, we approach the answer

N 704 ( m o d 1000 ) N\equiv \boxed{704} (mod 1000)

In my approach I have used the Carmichael's Lambda Function .

N = 200 4 200 3 200 2 200 1 200 0 199 9 \large N=2004^{2003^{2002^{2001^{2000^{1999^{\cdots}}}}}}

Now, since g c d ( 2004 , 1000 ) = 4 1 gcd(2004,1000)=4\neq1 , we cannot apply the theory of Carmichael's Lambda Function, directly.

Note that N 0 m o d ( 8 ) N\equiv0\mod(8) so if we find N m o d ( 125 ) N\mod(125) , then by Chinese remainder theorum we can get N m o d ( 1000 ) N\mod(1000) .

Now, since g c d ( 2004 , 125 ) = 1 gcd(2004,125)=1 we can use the Carmichael's Lambda Function.

λ ( 125 ) = 100 \lambda(125)=100

N 200 4 200 3 200 2 m o d 100 m o d 125 \Rightarrow N\equiv2004^{2003^{2002^{\cdots}}\mod100}mod125

Now again g c d ( 2003 , 100 ) = 1 gcd(2003,100)=1 , so again we can use λ ( 100 ) = 20 \lambda(100)=20

N 200 4 200 3 200 2 200 1 m o d ( 20 ) m o d ( 100 ) m o d ( 125 ) \large\Rightarrow N\equiv2004^{2003^{2002^{2001^{\cdots} }\mod(20)}\mod(100)}\mod(125)

Again we see that g c d ( 2002 , 20 ) = 2 1 gcd(2002,20)=2\neq1 ,so again we cannot apply the theory of Carmichael's Lambda Function.

Note that 200 2 200 1 200 0 0 m o d ( 4 ) 2002^{2001^{2000^{\cdots}}}\equiv0\mod(4) so, if we find 200 2 200 1 m o d ( 5 ) 2002^{2001^{\cdots}}\mod(5) , then by Chinese Remainder theorum, we get 200 2 200 1 m o d ( 20 ) 2002^{2001^{\cdots} }\mod(20) ,Now 200 2 200 1 2 200 1 m o d ( 5 ) 2002^{2001^{\cdots}}\equiv2^{2001^{\cdots}}\mod(5)

200 2 200 1 2 200 1 m o d ( 5 ) 2002^{2001^{\cdots}}\equiv2^{2001^{\cdots}}\mod(5)

200 2 200 1 2 200 1 m o d ( 5 ) \Rightarrow2002^{2001^{\cdots}}\equiv2^{2001^{\cdots}}\mod(5)

λ ( 5 ) = 4 \lambda(5)=4

200 2 200 1 2 200 1 200 0 m o d ( 4 ) m o d ( 5 ) \Rightarrow2002^{2001^{\cdots}}\equiv2^{2001^{2000^{\cdots}}\mod(4)}\mod(5)

Since 200 1 200 0 1 m o d ( 4 ) 2001^{2000^{\cdots}}\equiv1\mod(4)

200 2 200 1 2 m o d ( 5 ) \Rightarrow2002^{2001^{\cdots}}\equiv2\mod(5)

So we have

200 2 200 1 200 0 0 m o d ( 4 ) 2002^{2001^{2000^{\cdots}}}\equiv0\mod(4)

2 m o d ( 5 ) \text{ }\equiv2\mod(5)

So by Chinese Remainder theorum:

200 2 200 1 200 0 12 m o d ( 20 ) 2002^{2001^{2000^{\cdots}}}\equiv12\mod(20)

N 200 4 200 3 200 2 200 1 m o d ( 20 ) m o d ( 100 ) m o d ( 125 ) 200 4 200 3 12 m o d ( 100 ) m o d ( 125 ) \large\Rightarrow N\equiv2004^{2003^{2002^{2001^{\cdots} }\mod(20)}\mod(100)}\mod(125)\equiv2004^{2003^{12}\mod(100)}\mod(125)

200 4 41 m o d ( 125 ) 79 m o d 125 \equiv2004^{41}\mod(125)\equiv79\mod125

Finally we have, N 79 m o d ( 125 ) N\equiv79\mod(125) and N 0 m o d ( 8 ) N\equiv0\mod(8)

So By CRT we conclude N 704 m o d ( 1000 ) N\equiv\boxed{704}\mod(1000)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...