0% found this document useful (0 votes)
10 views4 pages

NumberTheory Chapter 02 GCD Eng

This document discusses the concept of Greatest Common Divisors (GCD) in number theory, defining it as the largest common divisor of two integers. It presents several theorems, including Bezout's Theorem, which relates the GCD to integer combinations, and the Euclidean Division Algorithm for calculating the GCD. Additionally, it outlines properties of GCD and provides examples to illustrate its application.

Uploaded by

yianxu111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views4 pages

NumberTheory Chapter 02 GCD Eng

This document discusses the concept of Greatest Common Divisors (GCD) in number theory, defining it as the largest common divisor of two integers. It presents several theorems, including Bezout's Theorem, which relates the GCD to integer combinations, and the Euclidean Division Algorithm for calculating the GCD. Additionally, it outlines properties of GCD and provides examples to illustrate its application.

Uploaded by

yianxu111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Number Theory Greatest Common Divisors Chapter 02

Greatest Common Divisors


Definition 1:
A Common Divisor, of the integers a and b, is an integer d such that d|a and d|b.

Definition 2:
The Greatest Common Divisor (GCD), of the integers a and b, is that divisor of a and b
which is the largest of them all.

Notation 1:
We indicate the Greatest Common Divisor of a and b as gcd(a, b).

Remark 1:
Sometimes (a, b) is used to indicate the GCD, however this does lead to confusion in cases and
we shall stick to the proper version, but note that in other reading material the (a, b) version
might occur.

Remark 2:
Note that the GCD is always a positive number. If c is negative and a common divisior of a
and b then −c is also a common divisor of a and b, but then we have that −c is positive and
hence greater than c. Therefore there must always be a positive common divisor and thus the
GCD of two numbers is always positive.

Theorem 1:
If a and b are integers, at least one of them non-zero, then gcd(a, b) exists.

Proof:

1 1|a and 1|b (from Chapter 1 Property 1)


2 Hence a and b have at least one divisor in common and therefore have a common divisor.
3 Now since a has finitely many divisors and/or b has finitely many divisors,
4 a and b have finitely many common divisors.
5 Therefore one of these common divisors must be the largest.
6 Thus, this largest is the greatest common divisor of a and b.
7 Hence the GCD exists for any a and b where at least one of them is non-zero.

QED

Example 1:
We demonstrate some greatest common divisors with actual numbers.

• gcd(3, 7) = 1

• gcd(21, 14) = 7

• gcd(30, 24) = 6

• gcd(6, 0) = 6, since 6|0.

• gcd(0, 0) does not exists, since one of the numbers isn’t non-zero.

ATMOSA 1 Copyright c 2008 - Phil Labuschagne


Number Theory Greatest Common Divisors Chapter 02

Theorem 2: (Bezout’s Theorem)


If a and b are integers, at least one of them non-zero, then gcd(a, b) = ua + vb for some integers
u and v. Furthermore, gcd(a, b) is the least positive integer which can be represented in this way.

Proof:

1 Construct a set C containing the following numbers: xa + yb


where x and y range over all the integers.
2 C contains positive integers. (exercise to show why)
3 Let d = au + bv be the least positive integer in C. (Exercises to show why)
4 We are now going to show that d|a and d|b.
5 Suppose that d - a.
6 Then there are integers q and r such that a = qd + r and 0 < r < d. (Why)
7 Hence we have that r = a − qd = a − q(ua + vb) = (1 − qu)a + (qv)b
8 And thus r belongs to C.
9 But this is impossible as r is a positive integer less than d.
10 Therefore d|a.
11 Similarly d|b.
12 Thus d is a common divisor of a and b.
13 Let e = gcd(a, b).
14 Then a = ea0 and b = eb0
15 Hence d = (ea0 )u + (eb0 )v = e(a0 u + b0 v).
16 Thus e|d.
17 Hence e ≤ d.
18 But d ≤ e by definition of e.
19 Therefore e = d.

QED

Remark 3:
This theorem is very important and we shall refer to it again when trying to find solutions to
equations. For example, if we are asked to find solutions to the equation 5x + 7y = 1 then at
least Bezout’s Theorem tells us that there will be solutions since gcd(5, 7) = 1. Thus, now we
know that we can try to find the solutions. On the other hand, if we are asked to find solutions
to 21x + 28y = 1, Bezout’s Theorem tells us that there are no solutions since gcd(21, 28) = 7.
Thus the first step is to use this theorem to check whether there are solutions or whether there
aren’t solutions.

Theorem 3:
If the integers a and b have a gcd(a, b) then every common divisor of a and b divides gcd(a, b).

Proof:

1 gcd(a, b) = ua + vb for some integers u and v.


2 Now, if d|a and d|b then d|ua + vb.
3 Hence any common divisor of a and b divides the gcd(a, b).

QED

ATMOSA 2 Copyright c 2008 - Phil Labuschagne


Number Theory Greatest Common Divisors Chapter 02

Properties
Property 1: gcd(a, b) = gcd(b, a).

Property 2: If a|b then gcd(a, b) = |a|.

Property 3: If a = 0 and b 6= 0 then gcd(a, b) = |b|.

Property 4: gcd(a, b) = gcd(a, −b) = gcd(−a, b) = gcd(−a, −b).

Property 5: For any integer c, gcd(a, b) = gcd(a, b + ac) = gcd(a + bc, b).

Property 6: For any integer m, gcd(ma, mb) = |m|gcd(a, b).


gcd(a,b)
Property 7: If d|a and d|b then gcd( ad , db ) = .
|d |

Property 8: gcd((a, b), c) = gcd(a, (b, c)) for any integers a, b and c.

Remark 4:
We quickly show why each of the above properties are indeed true.
1) Surely the greatest common divisor of a and b is also the greatest common divisor of b
and a.

2) a|a and a|b, hence (|a|)|a and (|a|)|b, and therefore |a| is a common divisor of a and b.
Suppose that there is a larger common divisor. Let d be this larger common divisor. So
d|a, and hence d|(|a|), but by definition d > |a| which is a contradiction since d|(|a|).
Thus |a| is indeed the largest common divisor of a and b.

3) (|b|)|0 and so by Property 2, gcd(0, b) = |b|

4) Let d = gcd(a, b). Hence d|a and d|b. Therefore d|−a and d|−b. Hence d is a common
divisor of any combination of these. Suppose that either a and −b or −a and b or −a and
−b has a common divisor e, which is larger than d. But then e|a and e|b so e|d, which is
a contradiction. So d is in fact the greatest common divisor of all of them.

5) Let d = gcd(a, b) and e = gcd(a, b + ac). Then d|b + ac, hence d|e. On the other hand
there are some integers u and v such that d = au + bv = a(u − vc) + (b + ac)v. Thus e|d
and therefore d = e. So gcd(a, b) = gcd(a, b + ac). Similarly, gcd(a, b) = gcd(a + bc, b).

6) Let d = gcd(ma, mb) and e = gcd(a, b). Since e|a, (me)|(ma). Since e|b, (me)|(mb).
Therefore (|m|e)|(ma) and (|m|e)|(mb). Thus (|m|e)|d. Furthermore, |m|e = m(au + bv)
for some integers u and v. So |m|e = m(au + bv) = (ma)u + (mb)v. Thus d|(|m|e).
Therefore gcd(ma, mb) = |m|gcd(a, b).

7) Assume d > 0 since otherwise we can just change d to −d. Let e = gcd( ad , db ) and
f = gcd(a, b). Then a = da0 , b = db0 and by Property 6, f = dgcd(a0 , b0 ) = de, hence
e = fd .

8) Let d = gcd((a, b), c) and e = gcd(a, (b, c)). Let f = gcd(a, b) and g = gcd(b, c). Now d|f
and d|c. Since d|f , d|a and d|b. Hence d|a, d|b and d|c. So d|a and d|g. Therefore d|e.
Similarly e|d. Thus gcd((a, b), c) = gcd(a, (b, c)).

ATMOSA 3 Copyright c 2008 - Phil Labuschagne


Number Theory Greatest Common Divisors Chapter 02

Remark 5:
Just as a reminder |x| means the absolute value of x and the absolute value of an integer is just
the integer without the sign. Thus if x is negative |x| just drops the sign. For instance, |5| = 5
and | − 5| = 5. So anything between the | . . . | is just made positive.

Remark 6:
We can also generalize the definition of greatest common divisor to more than two variables.
We can therefore also generalize Theorem 1, 2 and 3.

Definition 3:
The Greatest Common Divisor (GCD), of the integers a1 , a2 , . . . ak , is that divisor of
a1 , a2 , . . . ak−1 and ak which is the largest of them all.

Notation 2:
We indicate the Greatest Common Divisor of a1 , a2 , . . . ak as gcd(a1 , a2 , . . . ak ).

Theorem 4: (Euclidean Division Algorithm)


Let a and b be natural numbers. The following algorithm computes the gcd(a, b):
1) Denote by X the greater of a and b and the smaller one by Y . If a = b then X = Y = a.

2) Divide X by Y with a remainder: X = QY + R, where 0 ≤ R < Y .

3) If R = 0 then gcd(a, b) = Y and the algorithm ends. If not, continue with 4).

4) If R > 0 replace X by Y , then Y by R and go back to 2).

Proof:
We will leave this as an exercise.

Example 2:
Compute the greatest common divisor of 162 and 24.
Step 1) So X = 162 and Y = 24
Step 2) 162 = 6 × 24 + 18
Step 3) The remainder R = 18 and not 0. Thus we contnue with step 4.
Step 4) X = 24 and Y = 18. Step 2) Second time. 24 = 1 × 18 + 6
Step 3) Second time. The remainder R = 6 and not 0. Thus continue with step 4.
Step 4) Second time. X = 18 and Y = 6.
Step 2) Third time. 18 = 3 × 6 + 0.
Step 3) Third time. R = 0 and we stop. So gcd(162, 24) = 6.

Example 3:
We could also have condensed it a bit. Compute the greatest common divisor of 1001 and 209.
1001 = 4 × 209 + 165
209 = 1 × 165 + 44
165 = 3 × 44 + 33
44 = 1 × 33 + 11
33 = 3 × 11 + 0
Thus gcd(1001, 209) = 11.

ATMOSA 4 Copyright c 2008 - Phil Labuschagne

You might also like