Module 2 : GCD Computation

Lecture 1 : Elementary Number-Theory

Theorem 4 (GCD Recursion theorem )
For any non negative integer a and positive integer b gcd (a, b )= gcd (b, a mod b)

Proof:
We will show gcd (b, a mod b) | gcd (a, b ) and gcd (a, b ) | gcd (b, a mod b ). Let d = gcd (b, a mod b ). Thus d | b and d | (a mod b ).

Now a = b + a mod b. Hence a is a linear combination of b and a mod b and so d | a. Therefore d | a and d | b d | gcd (a, b) from Corollary 1.

Let d = gcd (a, b) d | a and d | b. Now a mod b = a – b and that implies a mod b is a linear combination of a and b. Thus d | (a mod b) d | b and d | (a mod b ) d | gcd (b , a mod b ) from Corollary 1.