Tower of 2's!

What are the last three digits of the greatest common divisor of 2 2 100 1 1 2^{2^{100}-1}-1 and 2 2 105 1 1 2^{2^{105}-1}-1 ?


The answer is 647.

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.

14 solutions

Aldrian Obaja
May 20, 2014

Let ( a , b ) (a,b) represents the greatest common divisor of a a and b b .

Theorem: ( 2 a 1 , 2 b 1 ) = 2 ( a , b ) 1 (2^a-1,2^b-1) = 2^{(a,b)}-1

Assuming the theorem holds, we have ( 2 2 100 1 1 , 2 2 105 1 1 ) = 2 ( 2 100 1 , 2 105 1 ) 1 \nonumber = 2 2 ( 100 , 105 ) 1 1 \nonumber = 2 2 5 1 1 \nonumber = 2 31 1 \nonumber = 2147483647 \begin{aligned}(2^{2^{100}-1}-1,2^{2^{105}-1}-1) &=& 2^{(2^{100}-1,2^{105}-1)}-1\nonumber\\ &=& 2^{2^{(100,105)}-1}-1\nonumber\\ &=& 2^{2^5-1}-1 \nonumber\\ &=& 2^{31}-1 \nonumber\\ &=& 2147483647\end{aligned} .

And so the last 3 digits are 647 647 .

We are left to prove the theorem. We will prove the theorem using this following lemma:

Lemma: m n 2 m 1 2 n 1 m|n \Rightarrow 2^m-1 | 2^n-1 (where m n m|n denotes n n is divisible by m m )

Proof of lemma: Let m = n k m=nk for some k k , and then we have 2 n 1 = i = 0 k 1 2 m ( i + 1 ) 2 m i = i = 0 k 1 2 m i ( 2 m 1 ) 2^n-1 = \sum_{i=0}^{k-1} 2^{m(i+1)}-2^{mi} = \sum_{i=0}^{k-1} 2^{mi}(2^m-1) , which proves the lemma.

Now, the theorem can be proven by proving that each term divides the other.

Let d = ( 2 a 1 , 2 b 1 ) d = (2^a-1, 2^b-1) .

Since ( a , b ) a (a,b)|a and ( a , b ) b (a,b)|b , then we have 2 ( a , b ) 1 2 a 1 2^{(a,b)}-1 | 2^a-1 and 2 ( a , b ) 1 2 b 1 2^{(a,b)}-1|2^b-1 and therefore 2 ( a , b ) 1 d 2^{(a,b)}-1 | d

Assume WLOG a b a\geq b . Then we have d 2 a 1 ( 2 b 1 ) = 2 b ( 2 a b 1 ) d | 2^a-1 - (2^b-1) = 2^b(2^{a-b}-1) . Since d d must be odd, ( d , 2 b ) = 1 (d,2^b)=1 and therefore d 2 a b 1 d|2^{a-b}-1 . By induction it can be shown that d 2 a % b 1 d|2^{a\%b}-1 (where a % b a\%b denotes the remainder of a a when divided by b b ), and so by Euclid Algorithm, we have d 2 ( a , b ) 1 d|2^{(a,b)}-1 .

This completes the proof for the theorem, and hence the answer is 647 647

Fatik Redy Hanif
May 20, 2014

It is obvious that n gcd ( a , b ) 1 n a 1 n^{\gcd(a,b)}-1|n^a-1 and n gcd ( a , b ) 1 n b 1 n^{\gcd(a,b)}-1|n^b-1 .

Lemma : gcd ( n a 1 , n b 1 ) = n gcd ( a , b ) 1 \gcd(n^a-1,n^b-1)= n^{\gcd(a,b)}-1 .

Proof : Let gcd ( a , b ) = x \gcd(a,b)= x

If there is a natural number y y such that y ( n x 1 ) n a 1 y \cdot( n^x-1)|n^a-1 and y ( n x 1 ) n b 1 y \cdot( n^x-1)|n^b-1 . Then we have n a 1 ( m o d y ( n x 1 ) ) ( i ) n^a \equiv 1 \pmod{y \cdot( n^x-1)} \ldots(i)

n b 1 ( m o d y ( n x 1 ) ) ( i i ) n^b \equiv 1 \pmod{y \cdot( n^x-1)} \ldots(ii)

By using Benzout Theorem, there are integers p , q p,q where gcd ( p , q ) = 1 \gcd(p,q)=1 such that a p + b q = x ap+bq=x . By i i and i i ii then we have n a p 1 ( m o d y ( n x 1 ) ) n^{ap} \equiv 1 \pmod{y \cdot( n^x-1)} , and n b q 1 ( m o d y ( n x 1 ) ) n^{bq} \equiv 1 \pmod{y \cdot( n^x-1)} . Multiply both of them we get n a p + b p 1 ( m o d y ( n x 1 ) ) n^{ap+bp} \equiv 1 \pmod{y \cdot( n^x-1)} n x 1 ( m o d y ( n x 1 ) ) \Rightarrow n^x \equiv 1 \pmod{y \cdot( n^x-1)} , then n x 1 0 ( m o d y ( n x 1 ) ) . n^x-1 \equiv 0 \pmod{y \cdot( n^x-1)}. Because n x 1 0 ( m o d y ( n x 1 ) ) n^x-1 \equiv 0 \pmod{y \cdot( n^x-1)} and y y is a natural number, then y = 1 y=1 . So gcd ( n a 1 , n b 1 ) = n gcd ( a , b ) 1 \gcd(n^a-1,n^b-1)= n^{\gcd(a,b)}-1 .
Back to the problem, by applying the lemma we get gcd ( 2 2 100 1 1 , 2 2 105 1 1 ) \gcd(2^{2^{100}-1}-1,2^{2^{105}-1}-1) = 2 gcd ( 2 100 1 , 2 105 1 1 =2^{\gcd(2^{100}-1,2^{105}-1}-1 = 2 2 gcd ( 100 , 105 ) 1 1 =2^{2^{\gcd(100,105)}-1}-1 = 2 2 5 1 1 =2^{2^5-1}-1 = 2 31 1 =2^{31}-1 = 2147483647. =2147483647. So, the answer is 647. 647.

An easier way to calculate 2 31 ( m o d 1000 ) 2^{31} \pmod{1000} is to use 2 10 24 ( m o d 1000 ) 2^{10} \equiv 24 \pmod{1000} , so 2 31 ( 2 10 ) 3 × 2 648 ( m o d 1000 ) 2^{31} \equiv (2^{10})^3 \times 2 \equiv 648 \pmod{1000} .

Calvin Lin Staff - 7 years ago

Using Euclidean Algorithm this formula (forgot the name). g c d ( a m 1 , a n 1 ) = a g c d ( m , n ) 1 gcd(a^{m}-1,a^{n}-1) = a^{gcd(m,n)}-1 ... Apply this formula we get...

  • g c d ( 2 2 100 1 1 , 2 2 105 1 1 ) gcd(2^{2^{100}-1}-1,2^{2^{105}-1}-1)
  • = 2 g c d ( 2 100 1 , 2 105 1 ) 1 = 2^{gcd(2^{100}-1,2^{105}-1)}-1
  • = 2 2 g c d ( 100 , 105 ) 1 1 = 2^{2^{gcd(100,105)}-1}-1
  • = 2 2 5 1 1 = 2^{2^{5}-1}-1
  • = 2147483647 =2147483647 .

Therefore, the last 3 digit is 647 \boxed{647} .

  • PS: I'll find the proof of the formula later.

If you have a proof, you can write here, I'll be really appreciated.

Samuraiwarm Tsunayoshi - 7 years, 5 months ago

Log in to reply

let m>n. We suppose gcd(a, 0) = a, where a>0. We use property: g c d ( a , b ) = g c d ( a b , b ) gcd(a, b) = gcd(a-b, b)

g c d ( a m 1 , a n 1 ) = g c d ( ( a m 1 ) ( a n 1 ) , a n 1 ) = gcd(a^m-1, a^n-1) = gcd((a^m-1)-(a^n-1), a^n-1) = = g c d ( a m a n , a n 1 ) = g c d ( a n × ( a m n 1 ) , a n 1 ) = =gcd(a^m-a^n, a^n-1)=gcd(a^n\times(a^{m-n}-1), a^n-1)= = g c d ( a m n 1 , a n 1 ) = g c d ( ( a m n 1 ) ( a n 1 ) , a n 1 ) = =gcd(a^{m-n}-1, a^n-1)= gcd((a^{m-n}-1)-(a^n-1), a^n-1) = = g c d ( a m n n 1 , a n 1 ) = = g c d ( a r 1 , a n 1 ) , =gcd(a^{m-n-n}-1, a^n-1)=\dots=gcd(a^{r}-1, a^n-1),

where r r is remainder after dividing the number m m by n n .

So we can do the same steps as in the Euclidean algorithm. g c d ( a m 1 , a n 1 ) = g c d ( a n 1 , a r 1 1 ) = gcd(a^m-1, a^n-1) = gcd(a^n-1, a^{r_1}-1) = g c d ( a r 1 1 , a r 2 1 ) = = a g c d ( m , n ) 1 gcd(a^{r_1}-1, a^{r_2}-1)=\dots=a^{gcd(m, n)}-1 So, we get g c d ( a m 1 , a n 1 ) = a g c d ( m , n ) 1 \boxed{gcd(a^m-1, a^n-1) = a^{gcd(m, n)}-1}

Alex Alex - 7 years, 5 months ago

Log in to reply

I have a little question. From g c d ( a r 1 1 , a r 2 ) = g c d ( a r t 1 , 1 ) = . . . = a r t 1 gcd(a^{r_{1}}-1,a^{r_{2}}) = gcd(a^{r_{t}}-1,1) = ... = a^{r_{t}}-1 , can we say that r t = g c d ( m , n ) r_{t} = gcd(m,n) ???

Samuraiwarm Tsunayoshi - 7 years, 5 months ago

Log in to reply

@Samuraiwarm Tsunayoshi We had proved, that g c d ( a m 1 , a n 1 ) = g c d ( a r 1 , a n 1 ) , gcd(a^m-1, a^n-1) = gcd(a^r-1, a^n - 1),

where m = n × q + r m= n\times q + r and r < n r < n

Then g c d ( a m 1 , a n 1 ) = g c d ( a n , a r 1 ) = gcd(a^m-1, a^n-1) = gcd(a^n, a^{r_1})= = g c d ( a r 1 1 , a r 2 1 ) = g c d ( a r 2 1 , a r 3 1 ) = =gcd(a^{r_1}-1, a^{r_2}-1) = gcd(a^{r_2}-1, a^{r_3}-1) = = = g c d ( a r k 1 1 , a r k 1 ) , =\dots= gcd(a^{r_{k-1}}-1, a^{r_k}-1),

where m = n × q 1 + r 1 m= n\times q_1 + r_1 and r 1 < n , r_1 < n,

n = r 1 × q 2 + r 2 n= r_1\times q_2 + r_2 and r 2 < r 1 r_2 < r_1 ,

r 1 = r 2 × q 3 + r 3 r_1= r_2\times q_3 + r_3 and r 3 < r 2 r_3 < r_2 ,

\dots

r k 2 = r k 1 × q k + r k r_{k-2}= r_{k-1}\times q_k + r_k and r k < r k 1 r_k < r_{k-1} ,

m > n > r 1 > r 2 > r 3 > > r k m > n > r_1 > r_2 > r_3 > \dots > r_k

r i r_i is non-negative integers and r i r i 1 r_i\ge r_{i-1}

Therefore after finit number of iterations we get r k = 0 r_k=0 and Euclidean Algorithm talk us, that r k 1 = g c d ( n , m ) r_{k-1} = gcd(n, m)

Use g c d ( c , 0 ) = c gcd(c, 0) = c we get g c d ( a r k 1 1 , a r k 1 ) = g c d ( a r k 1 1 , 0 ) = gcd(a^{r_{k-1}}-1, a^{r_k}-1)= gcd(a^{r_{k-1}}-1, 0) = = a r k 1 1 = a g c d ( m , n ) 1 = a^{r_{k-1}}-1 = a^{gcd(m, n)}-1

Alex Alex - 7 years, 5 months ago
Jimmi Simpson
May 20, 2014

A property exists of the gcd such that gcd ( 2 a 1 , 2 b 1 ) = 2 gcd ( a , b ) 1 \gcd{\left(2^a-1,2^b-1\right)}=2^{\gcd{\left(a,b\right)}}-1 . Applying this twice yields the gcd to be

gcd ( 2 2 100 1 , 2 2 105 1 1 ) = {\gcd\left(2^{2^{100}-1},2^{2^{105}-1}-1\right)}= 2 gcd ( 2 100 1 , 2 105 1 ) 1 = 2^{\gcd\left(2^{100}-1,2^{105}-1\right)}-1= 2 2 gcd ( 100 , 105 ) 1 1 = 2^{2^{\gcd\left(100,105\right)}-1}-1= 2 2 5 1 1 = 2^{2^5-1}-1= 2 31 1 2^{31}-1

Using the exponentiation by squaring method and only considering the last 3 digits of each multiplication, this is computed to be:

2 31 1 = 2^{31}-1= 2 ( 4 15 ) 1 = 2(4^{15})-1= 8 ( 1 6 7 ) 1 = 8(16^7)-1= 128 ( 25 6 3 ) 1 = 128(256^3)-1= 768 ( 536 ) 1 = 768(536)-1= 647 647

Psychic Psychic
May 20, 2014

We have the following theorem: Let a, b, x, y \in \mathbb{N*} then we will have (a^x-1; a^y-1)=a^{(x; y)}-1 \\ (x; y) denotes the greatest common divisor of x and y Applying the previous theorem, we have (2^{2^{100}-1}-1}; 2^{2^{105}-1}-1})=2^{(2^{100}-1; 2^{105}-1)}-1=2^{(100; 105)}-1 The answer is 647

Zi Song Yeoh
May 20, 2014

It is well-known that GCD(2^{m} - 1, 2^{n} - 1) = 2^{GCD(m, n)} - 1} (See this for the proof). So

G C D ( 2 2 100 1 , 2 2 105 1 ) = 2 2 5 1 1 GCD(2^{2^{100} - 1} , 2^{2^{105} - 1}) = 2^{2^{5} - 1} - 1 by repeated applications of the fact. So the last three digits is 647 \boxed{647}

Yi Zeng
May 20, 2014

G C D ( a n 1 , a m 1 ) = a G C D ( n , m ) 1 GCD(a^n -1, a^m -1) = a^{GCD(n,m)} -1

So, G C D ( 2 2 100 1 1 , 2 2 105 1 1 ) = 2 G C D ( 2 100 1 , 2 105 1 ) 1 = 2 2 G C D ( 100 , 105 ) 1 1 = 2 2 5 1 1 = 2 31 1 GCD(2^{2^{100} -1}-1, 2^{2^{105} -1}-1) = 2^{GCD(2^{100}-1, 2^{105}-1)} -1\\ = 2^{2^{GCD(100, 105) }-1} -1 = 2^{2^{5}-1} -1 = 2^{31} -1

Now it suffices to find 2 31 1 m o d 1000 2^{31} -1 \bmod 1000 , which is 647 647

note that gcd(a^m-1,a^n-1)=a^gcd(m,n)-1,then gcd(2^(2^105-1)-1,2^(2^100-1)-1) = 2^gcd(2^105-1,2^100-1)-1 = 2^(2^gcd(105,100)-1)-1 =2^31-1 note 2^31 = (2^10)^3 2-1 = (24^3) 2-1 = 824*2-1 = 647 (mod 1000)

Tahmid Hasan
May 20, 2014

From the above identity we get G . C . D . ( 2 2 100 1 1 , 2 2 105 1 1 ) G.C.D.(2^{2^{100}-1}-1,2^{2^{105}-1}-1) = 2 G . C . D ( 2 100 1 , 2 105 1 ) 1 =2^{G.C.D(2^{100}-1,2^{105}-1)}-1 But G . C . D . ( 2 100 1 , 2 105 1 ) = 2 G . C . D . ( 100 , 105 ) 1 = 2 5 1 = 31 G.C.D.(2^{100}-1,2^{105}-1)=2^{G.C.D.(100,105)}-1=2^5-1=31 So our required G.C.D. is 2 31 1 2^{31}-1 . Now 2 31 1 2 10 . 2 10 . 2 10 . 2 1 24.24.24.2 1 648 1 647 ( ( m o d 1 ) 000 ) 2^{31}-1 \equiv 2^{10}.2^{10}.2^{10}.2-1 \equiv 24.24.24.2-1 \equiv 648-1 \equiv 647 (\pmod 1000)

Anh Huy Nguyen
May 20, 2014

We use ( x ; y ) (x;y) to denote the greatest common divisor of x and y.

First we prove that for a , b , m , n N : ( a m 1 ; a n 1 ) = a ( m ; n ) 1 ( ) a,b,m,n \in \mathbb{N^*}: (a^m - 1; a^n-1)=a^{(m;n)}-1 \ \ \ (*)

Let d = ( m ; n ) a d 1 a m 1 ; a d 1 a n 1 d=(m;n) \Rightarrow a^d -1 | a^m - 1; a^d - 1 | a^n-1 . Hence $$a^d-1 | (a^m-1;a^n-1)\ \ \ (1)$$ Using Bezout's theorem, there exists x , y N x,y \in N such that x m y n = d xm - yn = d . Also, a m 1 a m x 1 ; a n 1 a n y 1 a^m - 1 | a^{mx}-1 ; a^n - 1 | a^{ny}-1

( a m 1 ; a n 1 ) a m x a n y = a n y ( a d 1 ) \Rightarrow (a^m-1;a^n-1) | a^{mx}-a^{ny}=a^{ny}(a^d-1) . Hence $$(a^m-1;a^n-1) | a^d-1\ \ \ (2)$$ Since it's obvious that ( a m 1 ; a n y ) = ( a n 1 ; a n y ) = 1 (a^m-1;a^{ny}) = (a^n-1;a^{ny}) =1 .

From (1) and (2) we have ( a m 1 ; a n 1 ) = a d 1 (a^m-1;a^n-1) = a^d-1 (QED)

Using (*), it is easy to see that $$(2^{2^{100}-1}-1; 2^{2^{105}-1}-1) = 2^{(2^{100}-1;2^{105}-1)}-1=2^{(100;105)}-1=2^5-1$$ Thus we need to evaluate the last three digits of 2 5 1 2^5-1 , which is 647.

Should have been 2^{2^5-1} -1 in the last step.

Calvin Lin Staff - 7 years ago
Not Real
Jan 18, 2014

First we prove the lemma we use twice here, that is g c d ( a m 1 , a n 1 ) = a gcd ( m , n ) 1 gcd\left(a^m-1,a^n-1\right)=a^{\gcd(m,n)}-1 It is fairly easy to prove. Let m > n m>n and m = n q + r m=nq+r with 0 r < n 0\leq r<n . From Eulidean algorithm, we get g = g c d ( a m 1 , a n 1 ) g=gcd\left(a^m-1,a^n-1\right) . Then, g = g c d ( a n 1 , a m a n ) = g c d ( a n 1 , a n q ( a m n q 1 ) ) g=gcd\left(a^n-1,a^m-a^n\right)=gcd\left(a^n-1,a^{nq}(a^{m-nq}-1)\right) . And since g c d ( a n 1 , a n q ) = 1 gcd(a^n-1,a^{nq})=1 , we have G = g c d ( a n 1 , a r 1 ) G=gcd\left(a^n-1,a^r-1\right) . Now, again repeating the same process we find that, this only ends when we reach the greatest common divisor of m , n m,n . Hence, the claim. Now it is quite straight forward to prove. First, g c d ( 2 2 100 1 1 , 2 2 105 1 1 ) = 2 gcd ( 2 100 1 , 2 105 1 ) 1 gcd\left(2^{2^{100}-1}-1,2^{2^{105}-1}-1\right)=2^{\gcd\left(2^{100}-1,2^{105}-1\right)}-1 Again, gcd ( 2 100 1 , 2 105 1 ) = 2 gcd ( 100 , 105 ) 1 = 2 5 1 = 31 \gcd\left(2^{100}-1,2^{105}-1\right)=2^{\gcd(100,105)}-1=2^5-1=31 Therefore, G = 2 31 1 = 2147483647 G=2^{31}-1=2147483647 . So, the final answer is 647 \boxed{647} .

I forgot to mention we were looking for the result m o d 1000 \mod 1000 , not the entire result. If someone is wondering how I found 2 31 2^{31} , I had it in my memory. Nevertheless, we can find a n a^n in log n \log n time using fast exponentiation method. For example, here, we could do this by: 2 31 m o d 1000 = 2 ( 2 15 ) 2 m o d 1000 2^{31}\mod 1000=2\cdot\left(2^{15}\right)^2\mod 1000 So again, split 15 15 in the same way until you reach 1 1 . Then just substitute back and find the original answer. Note: This can be done directly too if we consider the number n n in binary.

not real - 7 years, 4 months ago

*Lemma: * For all positive integers m m and n n where m > n m>n , gcd ( 2 m 1 , 2 n 1 ) = gcd ( 2 m 1 , 2 m n 1 ) \gcd (2^m - 1, 2^n - 1 )= \gcd (2^m-1, 2^{m-n}-1 )
*Proof: * Note that both 2 m 1 2^m-1 and 2 n 1 2^n-1 are odd, so gcd ( 2 m 1 , 2 ) = gcd ( 2 n 1 , 2 ) = 1 \gcd (2^m-1, 2)= \gcd (2^n-1, 2)= 1 . We then have: gcd ( 2 m 1 , 2 n 1 ) = gcd ( 2 n 1 , 2 m n ( 2 n 1 ) ) = gcd ( 2 m 1 , 2 m 2 m n ) = gcd ( 2 m 1 , 2 m 1 ( 2 m n 1 ) ) = gcd ( 2 m 1 , 2 m n 1 ) (QED) \begin{array}{lcl} \gcd (2^m-1, 2^n-1) & = \gcd ( 2^n-1, 2^{m-n} ( 2^n - 1 ) ) \\ & = & \gcd (2^m-1, 2^m - 2^{m-n}) \\ & = & \gcd (2^m-1, 2^m -1 - (2^{m-n}-1) ) \\ & = & \gcd (2^m-1, 2^{m-n} - 1 ) \text{ (QED)} \\ \end{array}

Now, let m = q n + r m= qn+r , where q , r q, r are non-negative integers and 0 r < n 0 \leq r < n (Division algorithm). Repeated application of the lemma yields: gcd ( 2 m 1 , 2 n 1 ) = gcd ( 2 q n + r 1 , 2 n 1 ) = gcd ( 2 q n + r 1 , 2 ( q 1 ) n + r 1 ) = gcd ( 2 q n + r 1 , 2 ( q 2 ) n + r 1 ) = = gcd ( 2 q n + r 1 , 2 r 1 ) \begin{array}{lcl} \gcd (2^m-1, 2^n-1) & = & \gcd (2^{qn+r}-1, 2^n-1) \\ & = & \gcd (2^{qn+r}-1, 2^{(q-1)n+r}-1 ) \\ & = & \gcd (2^{qn+r}-1, 2^{(q-2)n+r}-1 ) \\ & = & \cdots \\ & = & \gcd (2^{qn+r}-1, 2^r-1 ) \end{array}

Notice that by Euclidean algorithm, gcd ( q n + r , n ) = gcd ( q n + r , r ) \gcd (qn+r, n) = \gcd (qn+r, r) . Thus, if we continue applying this process, we will eventually find out that gcd ( 2 m 1 , 2 n 1 ) = 2 gcd ( m , n ) 1 \gcd (2^m-1, 2^n-1)= 2^{\gcd (m,n)} -1 From this result, we find out that: gcd ( 2 100 1 , 2 105 1 ) = 2 gcd ( 100 , 105 ) 1 = 2 5 1 = 31 \gcd (2^{100}-1, 2^{105}-1)= 2^{\gcd (100, 105) - 1 }= 2^5- 1= 31 gcd ( 2 2 100 1 , 2 2 105 1 ) = ( 2 gcd ( 2 100 1 , 2 105 1 ) 1 = 2 31 1 \gcd (2^{2^{100}-1}, 2^{2^{105}-1} ) = (2^{\gcd (2^{100}-1, 2^{105}-1) } - 1= 2^{31}-1 So, it suffices to find the last three digits of 2 31 1 2^{31}-1 . We have: 2 31 1 = 2 × ( 1024 ) 3 1 2 × 2 4 3 1 ( m o d 1000 ) 2 × 824 1 ( m o d 1000 ) 647 ( m o d 1000 ) \begin{array}{lcl} 2^{31}-1 & = & 2 \times (1024)^3 - 1 \\ & \equiv & 2 \times 24^3 - 1 \pmod{1000} \\ & \equiv & 2 \times 824- 1 \pmod{1000} \\ & \equiv & 647 \pmod{1000} \end{array} We thus conclude our answer is 647 \boxed{647} .

Something's wrong with the LaTeX at the fifth line. Sorry!

Sreejato Bhattacharya - 7 years, 5 months ago
David Austen
Jan 4, 2014

Trivial problem.

It is well known fact that g c d ( a n 1 , a m 1 ) = a k 1 gcd(a^n-1, a^m-1) = a^k-1 where k = g c d ( n , m ) k=gcd(n,m)

So we know g c d ( 2 100 1 , 2 105 1 ) = 2 5 1 = 31 gcd(2^{100}-1, 2^{105}-1) = 2^5-1 = 31

So we know g c d ( 2 2 100 1 1 , 2 2 105 1 1 ) = 2 31 1 gcd(2^{2^{100}-1}-1, 2^{2^{105}-1}-1) = 2^{31}-1

And by simple calculation mod 1000 1000 the answer is 647 647

The formula can be proven like this (but I will only prove it for a a even. The case a a odd is almost equivalent, it just requires a little bit more of trivial annoying work.

Call f ( x ) = a x 1 f(x) = a^x-1 for convenience. Then it is obvious by simple factorization that f ( k ) f ( n ) , f ( m ) f(k) | f(n), f(m) . Therefore f ( k ) g c d ( f ( n ) , f ( m ) f(k) | gcd(f(n),f(m)

Now we need to know g c d ( f ( n ) , f ( m ) ) f ( k ) gcd(f(n),f(m)) | f(k) to finish. To do this, we assume the contrary. Take p b f ( n ) , f ( m ) p^b | f(n), f(m) but p b p^b does not divide f ( k ) f(k) . Then we use the Lifting The Exponent Lemma. We know p p is odd since a a is even.

Call d d the order of a a mod p p . Then clearly d n , m d | n,m and so d k d | k . Now we know that b v p ( a n 1 ) = v p ( a g 1 ) + v p ( n ) b \le v_p (a^n-1) = v_p (a^g-1) + v_p(n) since v p ( g ) = 0 v_p(g)=0 . The same is true for m m . So say WLOG v p ( m ) v p ( n ) v_p(m) \le v_p(n) and so b v p ( a n 1 ) = v p ( a g 1 ) + v p ( m ) = v p ( a g 1 ) + v p ( k ) = v p ( a k 1 ) b \le v_p (a^n-1) = v_p (a^g-1) + v_p(m) = v_p(a^g-1) + v_p(k) = v_p(a^k-1) since d k d | k and k = g c d ( m . n ) k = gcd(m.n) . So we're done.

Im pretty sure theres an easier way to do this with euclidean algorithm, but this proof is correct and completes the proof of the problem.

For a a odd we have to take care of p = 2 p = 2 and use the ugly form of the Lemma, so I won't do that.

David Austen - 7 years, 5 months ago
Kaan Dokmeci
Dec 25, 2013

It is easy to show gcd ( x a 1 , x b 1 ) = x gcd ( a , b ) 1 \text{gcd}(x^a-1, x^b-1)=x^{\text{gcd}(a, b)}-1 . Applying this, we see the gcd is 2 k 1 2^k-1 where k = gcd ( 2 100 1 , 2 105 1 ) k=\text{gcd}(2^{100}-1, 2^{105}-1) . But we know this is 2 5 1 = 31 2^5-1=31 , so the answer is 2 31 1 2^{31}-1 which ends in 647 \boxed{647}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...