Math 326, March 12 - Greatest Common Divisor

The greatest common divisor of two numbers of two numbers isn't too hard to find for small numbers, but it would be nice to have a computer help us with larger numbers.  Remember that the greatest common divisor (GCD) of two numbers is the largest integer which divides evenly into both numbers (leaving no remainder).

We use Euclid's Algorithm to discern the GCD, which is a process reasonably easy to implement in a spreadsheet.  Suppose we are given to numbers, the larger one we name L, the smaller we name S.  Then if we divide S into L we will get something like:
       L = dS + r
where r is the remainder.  Now, whatever the GCD of L and S is, it will divide both L and S, so it should divide r as well.  So we repeat this division, but now using S =L2 and r=S2.  Keep repeating until there isn't a remainder, then the last Sn you had is the GCD.

Additional Questions