What are the last three digits of the greatest common divisor of 2 2 1 0 0 − 1 − 1 and 2 2 1 0 5 − 1 − 1 ?
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.
It is obvious that n g cd ( a , b ) − 1 ∣ n a − 1 and n g cd ( a , b ) − 1 ∣ n b − 1 .
Lemma : g cd ( n a − 1 , n b − 1 ) = n g cd ( a , b ) − 1 .
Proof : Let g cd ( a , b ) = x
If there is a natural number y such that y ⋅ ( n x − 1 ) ∣ n a − 1 and y ⋅ ( n x − 1 ) ∣ n b − 1 . Then we have n a ≡ 1 ( m o d y ⋅ ( n x − 1 ) ) … ( i )
n b ≡ 1 ( m o d y ⋅ ( n x − 1 ) ) … ( i i )
By using Benzout Theorem, there are integers
p
,
q
where
g
cd
(
p
,
q
)
=
1
such that
a
p
+
b
q
=
x
.
By
i
and
i
i
then we have
n
a
p
≡
1
(
m
o
d
y
⋅
(
n
x
−
1
)
)
, and
n
b
q
≡
1
(
m
o
d
y
⋅
(
n
x
−
1
)
)
.
Multiply both of them we get
n
a
p
+
b
p
≡
1
(
m
o
d
y
⋅
(
n
x
−
1
)
)
⇒
n
x
≡
1
(
m
o
d
y
⋅
(
n
x
−
1
)
)
, then
n
x
−
1
≡
0
(
m
o
d
y
⋅
(
n
x
−
1
)
)
.
Because
n
x
−
1
≡
0
(
m
o
d
y
⋅
(
n
x
−
1
)
)
and
y
is a natural number, then
y
=
1
.
So
g
cd
(
n
a
−
1
,
n
b
−
1
)
=
n
g
cd
(
a
,
b
)
−
1
.
Back to the problem, by applying the lemma we get
g
cd
(
2
2
1
0
0
−
1
−
1
,
2
2
1
0
5
−
1
−
1
)
=
2
g
cd
(
2
1
0
0
−
1
,
2
1
0
5
−
1
−
1
=
2
2
g
cd
(
1
0
0
,
1
0
5
)
−
1
−
1
=
2
2
5
−
1
−
1
=
2
3
1
−
1
=
2
1
4
7
4
8
3
6
4
7
.
So, the answer is
6
4
7
.
Using Euclidean Algorithm this formula (forgot the name). g c d ( a m − 1 , a n − 1 ) = a g c d ( m , n ) − 1 ... Apply this formula we get...
Therefore, the last 3 digit is 6 4 7 .
If you have a proof, you can write here, I'll be really appreciated.
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 )
g c d ( a m − 1 , a n − 1 ) = g c d ( ( 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 ) = = g c d ( a m − n − 1 , a n − 1 ) = g c d ( ( 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 ) ,
where r is remainder after dividing the number m by 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 ) = g c d ( a r 1 − 1 , a r 2 − 1 ) = ⋯ = a g c d ( m , n ) − 1 So, we get g c d ( a m − 1 , a n − 1 ) = a g c d ( m , n ) − 1
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 , can we say that r t = g c d ( m , n ) ???
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 ) ,
where m = n × q + r and r < n
Then g c d ( a m − 1 , a n − 1 ) = g c d ( 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 ) = = ⋯ = g c d ( a r k − 1 − 1 , a r k − 1 ) ,
where m = n × q 1 + r 1 and r 1 < n ,
n = r 1 × q 2 + r 2 and r 2 < r 1 ,
r 1 = r 2 × q 3 + r 3 and r 3 < r 2 ,
…
r k − 2 = r k − 1 × q k + r k and r k < r k − 1 ,
m > n > r 1 > r 2 > r 3 > ⋯ > r k
r i is non-negative integers and r i ≥ r i − 1
Therefore after finit number of iterations we get r k = 0 and Euclidean Algorithm talk us, that r k − 1 = g c d ( n , m )
Use g c d ( 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 ) = = a r k − 1 − 1 = a g c d ( m , n ) − 1
A property exists of the gcd such that g cd ( 2 a − 1 , 2 b − 1 ) = 2 g cd ( a , b ) − 1 . Applying this twice yields the gcd to be
g cd ( 2 2 1 0 0 − 1 , 2 2 1 0 5 − 1 − 1 ) = 2 g cd ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) − 1 = 2 2 g cd ( 1 0 0 , 1 0 5 ) − 1 − 1 = 2 2 5 − 1 − 1 = 2 3 1 − 1
Using the exponentiation by squaring method and only considering the last 3 digits of each multiplication, this is computed to be:
2 3 1 − 1 = 2 ( 4 1 5 ) − 1 = 8 ( 1 6 7 ) − 1 = 1 2 8 ( 2 5 6 3 ) − 1 = 7 6 8 ( 5 3 6 ) − 1 = 6 4 7
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
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 1 0 0 − 1 , 2 2 1 0 5 − 1 ) = 2 2 5 − 1 − 1 by repeated applications of the fact. So the last three digits is 6 4 7
G C D ( a n − 1 , a m − 1 ) = a G C D ( n , m ) − 1
So, G C D ( 2 2 1 0 0 − 1 − 1 , 2 2 1 0 5 − 1 − 1 ) = 2 G C D ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) − 1 = 2 2 G C D ( 1 0 0 , 1 0 5 ) − 1 − 1 = 2 2 5 − 1 − 1 = 2 3 1 − 1
Now it suffices to find 2 3 1 − 1 m o d 1 0 0 0 , which is 6 4 7
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)
From the above identity we get G . C . D . ( 2 2 1 0 0 − 1 − 1 , 2 2 1 0 5 − 1 − 1 ) = 2 G . C . D ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) − 1 But G . C . D . ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) = 2 G . C . D . ( 1 0 0 , 1 0 5 ) − 1 = 2 5 − 1 = 3 1 So our required G.C.D. is 2 3 1 − 1 . Now 2 3 1 − 1 ≡ 2 1 0 . 2 1 0 . 2 1 0 . 2 − 1 ≡ 2 4 . 2 4 . 2 4 . 2 − 1 ≡ 6 4 8 − 1 ≡ 6 4 7 ( ( m o d 1 ) 0 0 0 )
We use ( 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 ( ∗ )
Let d = ( m ; n ) ⇒ 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 such that x m − y n = d . Also, a m − 1 ∣ a m x − 1 ; a n − 1 ∣ a n y − 1
⇒ ( a m − 1 ; a n − 1 ) ∣ a m x − a n y = a n y ( 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 .
From (1) and (2) we have ( 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 , which is 647.
First we prove the lemma we use twice here, that is g c d ( a m − 1 , a n − 1 ) = a g cd ( m , n ) − 1 It is fairly easy to prove. Let m > n and m = n q + r with 0 ≤ r < n . From Eulidean algorithm, we get g = g c d ( a m − 1 , a n − 1 ) . 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 ) ) . And since g c d ( a n − 1 , a n q ) = 1 , we have G = g c d ( a n − 1 , a r − 1 ) . Now, again repeating the same process we find that, this only ends when we reach the greatest common divisor of m , n . Hence, the claim. Now it is quite straight forward to prove. First, g c d ( 2 2 1 0 0 − 1 − 1 , 2 2 1 0 5 − 1 − 1 ) = 2 g cd ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) − 1 Again, g cd ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) = 2 g cd ( 1 0 0 , 1 0 5 ) − 1 = 2 5 − 1 = 3 1 Therefore, G = 2 3 1 − 1 = 2 1 4 7 4 8 3 6 4 7 . So, the final answer is 6 4 7 .
I forgot to mention we were looking for the result m o d 1 0 0 0 , not the entire result. If someone is wondering how I found 2 3 1 , I had it in my memory. Nevertheless, we can find a n in lo g n time using fast exponentiation method. For example, here, we could do this by: 2 3 1 m o d 1 0 0 0 = 2 ⋅ ( 2 1 5 ) 2 m o d 1 0 0 0 So again, split 1 5 in the same way until you reach 1 . Then just substitute back and find the original answer. Note: This can be done directly too if we consider the number n in binary.
*Lemma: *
For all positive integers
m
and
n
where
m
>
n
,
g
cd
(
2
m
−
1
,
2
n
−
1
)
=
g
cd
(
2
m
−
1
,
2
m
−
n
−
1
)
*Proof: *
Note that both
2
m
−
1
and
2
n
−
1
are odd, so
g
cd
(
2
m
−
1
,
2
)
=
g
cd
(
2
n
−
1
,
2
)
=
1
. We then have:
g
cd
(
2
m
−
1
,
2
n
−
1
)
=
g
cd
(
2
n
−
1
,
2
m
−
n
(
2
n
−
1
)
)
=
=
=
g
cd
(
2
m
−
1
,
2
m
−
2
m
−
n
)
g
cd
(
2
m
−
1
,
2
m
−
1
−
(
2
m
−
n
−
1
)
)
g
cd
(
2
m
−
1
,
2
m
−
n
−
1
)
(QED)
Now, let m = q n + r , where q , r are non-negative integers and 0 ≤ r < n (Division algorithm). Repeated application of the lemma yields: g cd ( 2 m − 1 , 2 n − 1 ) = = = = = g cd ( 2 q n + r − 1 , 2 n − 1 ) g cd ( 2 q n + r − 1 , 2 ( q − 1 ) n + r − 1 ) g cd ( 2 q n + r − 1 , 2 ( q − 2 ) n + r − 1 ) ⋯ g cd ( 2 q n + r − 1 , 2 r − 1 )
Notice that by Euclidean algorithm, g cd ( q n + r , n ) = g cd ( q n + r , r ) . Thus, if we continue applying this process, we will eventually find out that g cd ( 2 m − 1 , 2 n − 1 ) = 2 g cd ( m , n ) − 1 From this result, we find out that: g cd ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) = 2 g cd ( 1 0 0 , 1 0 5 ) − 1 = 2 5 − 1 = 3 1 g cd ( 2 2 1 0 0 − 1 , 2 2 1 0 5 − 1 ) = ( 2 g cd ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) − 1 = 2 3 1 − 1 So, it suffices to find the last three digits of 2 3 1 − 1 . We have: 2 3 1 − 1 = ≡ ≡ ≡ 2 × ( 1 0 2 4 ) 3 − 1 2 × 2 4 3 − 1 ( m o d 1 0 0 0 ) 2 × 8 2 4 − 1 ( m o d 1 0 0 0 ) 6 4 7 ( m o d 1 0 0 0 ) We thus conclude our answer is 6 4 7 .
Something's wrong with the LaTeX at the fifth line. Sorry!
Trivial problem.
It is well known fact that g c d ( a n − 1 , a m − 1 ) = a k − 1 where k = g c d ( n , m )
So we know g c d ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) = 2 5 − 1 = 3 1
So we know g c d ( 2 2 1 0 0 − 1 − 1 , 2 2 1 0 5 − 1 − 1 ) = 2 3 1 − 1
And by simple calculation mod 1 0 0 0 the answer is 6 4 7
The formula can be proven like this (but I will only prove it for a even. The case a odd is almost equivalent, it just requires a little bit more of trivial annoying work.
Call f ( x ) = a x − 1 for convenience. Then it is obvious by simple factorization that f ( k ) ∣ f ( n ) , f ( m ) . Therefore f ( k ) ∣ g c d ( f ( n ) , f ( m )
Now we need to know g c d ( f ( n ) , f ( m ) ) ∣ f ( k ) to finish. To do this, we assume the contrary. Take p b ∣ f ( n ) , f ( m ) but p b does not divide f ( k ) . Then we use the Lifting The Exponent Lemma. We know p is odd since a is even.
Call d the order of a mod p . Then clearly d ∣ n , m and so d ∣ k . Now we know that b ≤ v p ( a n − 1 ) = v p ( a g − 1 ) + v p ( n ) since v p ( g ) = 0 . The same is true for m . So say WLOG v p ( m ) ≤ 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 ) since d ∣ k and k = g c d ( 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 odd we have to take care of p = 2 and use the ugly form of the Lemma, so I won't do that.
It is easy to show gcd ( x a − 1 , x b − 1 ) = x gcd ( a , b ) − 1 . Applying this, we see the gcd is 2 k − 1 where k = gcd ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) . But we know this is 2 5 − 1 = 3 1 , so the answer is 2 3 1 − 1 which ends in 6 4 7
Problem Loading...
Note Loading...
Set Loading...
Let ( a , b ) represents the greatest common divisor of a and b .
Theorem: ( 2 a − 1 , 2 b − 1 ) = 2 ( a , b ) − 1
Assuming the theorem holds, we have ( 2 2 1 0 0 − 1 − 1 , 2 2 1 0 5 − 1 − 1 ) = = = = = 2 ( 2 1 0 0 − 1 , 2 1 0 5 − 1 ) − 1 \nonumber 2 2 ( 1 0 0 , 1 0 5 ) − 1 − 1 \nonumber 2 2 5 − 1 − 1 \nonumber 2 3 1 − 1 \nonumber 2 1 4 7 4 8 3 6 4 7 .
And so the last 3 digits are 6 4 7 .
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 (where m ∣ n denotes n is divisible by m )
Proof of lemma: Let m = n k for some 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 ) , 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 ) .
Since ( a , b ) ∣ a and ( a , b ) ∣ b , then we have 2 ( a , b ) − 1 ∣ 2 a − 1 and 2 ( a , b ) − 1 ∣ 2 b − 1 and therefore 2 ( a , b ) − 1 ∣ d
Assume WLOG a ≥ b . Then we have d ∣ 2 a − 1 − ( 2 b − 1 ) = 2 b ( 2 a − b − 1 ) . Since d must be odd, ( d , 2 b ) = 1 and therefore d ∣ 2 a − b − 1 . By induction it can be shown that d ∣ 2 a % b − 1 (where a % b denotes the remainder of a when divided by b ), and so by Euclid Algorithm, we have d ∣ 2 ( a , b ) − 1 .
This completes the proof for the theorem, and hence the answer is 6 4 7