32 Euclidean Algorithm
We begin by introducing the greatest common divisor before following with the Euclidean Algorithm [28].
Definition. Greatest Common Divisor
Let 
 be positive and neither 
 nor 
 are equal to 0. The greatest common divisor of (a,b) is the largest positive integer that divides both 
 and 
.
Theorem: Euclidean Algorithm
Suppose 
 such that 
 and 
, then there are integers 
 and 
 such that 
.
Example:
Find the 
 for the following pairs of integers, using the Euclidean algorithm. 
, 
  [28].
      
Thus we have found ![]()
Now there is an expanded version of the Euclidean algorithm but for time’s sake we will leave it at just the shortened definition with the example. We are actually quite familiar with this idea of the greatest common divisor as we were required to find the gcd in a few examples in the previous section on Modern Algebra. In this section we use the concept of the greatest common divisor to introduce two vital theorems associated with solving linear congruence problems.
Theorem:
Let 
 both be positive. Let 
 be the gcd of 
 and 
 for 
. The equation 
 has a solution if and only if 
 divides 
. When 
 dived 
, the equation has exactly 
 solutions in modulus 
. [12]
Theorem:
Let 
 be the gcd of positive integers 
 and 
. The congruence 
 has a solution if and only if 
 divides 
. When this is the case, the solutions are the integers in exactly 
 distinct classes modulus 
.[12]
Example:
Describe all solutions of the given congruence, ![]()
Firstly we can simplify 
, we know that 
 fits into 
 once so if we subtract 
 from 
 we should get the remainder 
. Thus we can rewrite our congruence as 
 now let 
 we know 
 because the divisors of 12 are 1,2,3,4,6,12 and the divisors of 24 are 1,2,3,4,6,8,12,24 and as we can see the greatest common divisor is 12. Utilizing theorem 2.12 let 
 and 
, since 12 cannot divide 15 we conclude that there are no solutions for 
.
This last example emphasizes the power of these theorems. We are able to apply theorems in order to skip attempting infinite possible solutions only to come to the same conclusion that there are no solutions to the given congruence.