Module 2 : GCD Computation

Lecture 1 : Elementary Number-Theory

Corollary 1:

For any integers a and b, if d | a and d | b then d | gcd(a, b).

Relatively prime integers

Two integers a, b are said to be relatively prime if their only common divisor is 1, that is, if gcd(a, b) = 1.

Theorem 2
For any integers a, b, and p, if both gcd(a, p) = 1 and gcd(b, p) = 1, then gcd(ab, p) = 1.

Proof :
gcd(a, p) = 1 ∃ x, y ∈ Z such that ax + py = 1
gcd(b, p) = 1 ∃ x′ y′ ∈ Z such that bx′ + py′ =
1

Multiplying these equations and rearranging, we have

ab(x x') + p(ybx' + y'ax + pyy') = 1.

Thus linear combination of a, b and p is equal to 1
Thus we have gcd (ab, p ) = 1

Theorem 3
For all primes p and all integers a, b if p | ab p | a or p | b .

Proof:
Assume otherwise, i.e., p | a and p | b. Since p is prime only 2 factors are there for p i.e. 1 & p. Therefore gcd(a, p) =1 and gcd(b, p) =1 then gcd (ab, p)=1 p | ab.

Unique factorization

A composite integer a can be written in exactly one way as a product of the form:
a =

Where pi’s are primes ∀i (1..k) such that p1 < p2 < p3 -----< pk

and ei Z+ ( i=1,2,-----k )