GCD of large numbers

Find the greatest common divisor(GCD) of 2 100 2^{100} -1 and 2 120 2^{120} -1

2 20 2^{20} +1 2 20 2^{20} -1 2 10 2^{10} -1 2 12 2^{12} -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.

1 solution

Mathh Mathh
Jun 17, 2014

Theorem:

gcd ( 2 a 1 , 2 b 1 ) = 2 gcd ( a , b ) 1 \gcd(2^a-1, 2^b-1)=2^{\gcd(a,b)}-1 for some integers a a , b b .

Proof:

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

We have that gcd ( a , b ) \gcd(a,b) is always a x + b y ax+by for some integers x , y x,y .

We want to prove that d = 2 gcd ( a , b ) 1 d=2^{\gcd(a,b)}-1 . It would be sufficient to prove that d 2 gcd ( a , b ) 1 d\mid 2^{\gcd(a,b)}-1 and 2 gcd ( a , b ) 1 d 2^{\gcd(a,b)}-1\mid d .

1 ) 1) We know that 2 a 1 ( m o d d ) 2^a\equiv 1\pmod d and 2 b 1 ( m o d d ) 2^b\equiv 1\pmod d , therefore 2 gcd ( a , b ) ( 2 a ) x ( 2 b ) y 1 ( m o d d ) 2^{\gcd(a,b)}\equiv (2^a)^x (2^b)^y\equiv 1\pmod d . Hence d 2 gcd ( a , b ) 1 d\mid 2^{\gcd(a,b)}-1 .

2 ) 2) We have 2 gcd ( a , b ) 1 ( 2 gcd ( a , b ) ) k 1 k = 2 a 1 2^{\gcd(a,b)}-1\mid (2^{\gcd(a,b)})^k-1^k=2^a-1 for some integer k k . Similarly 2 gcd ( a , b ) 1 2 b 1 2^{\gcd(a,b)}-1\mid 2^b-1 . Hence 2 gcd ( a , b ) 1 d 2^{\gcd(a,b)}-1\mid d .

( 1 ) ( 2 ) d = 2 gcd ( a , b ) 1 (1)(2)\iff d=2^{\gcd(a,b)}-1 .

Or what about writing 2^100-1 and 2^120-1 as the difference of two squares, , and then factoring, long and convoluted-but certainly an alternative for people who dont know the above theorem?

Jayakumar Krishnan - 6 years, 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...