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
 be positive and neither  nor
 nor  are equal to 0. The greatest common divisor of (a,b) is the largest positive integer that divides both
 are equal to 0. The greatest common divisor of (a,b) is the largest positive integer that divides both  and
 and  .
.
Theorem: Euclidean Algorithm
Suppose  such that
 such that  and
 and  , then there are integers
, then there are integers  and
 and  such that
 such that  .
.
Example:
Find the  for the following pairs of integers, using the Euclidean algorithm.
 for the following pairs of integers, using the Euclidean algorithm.  ,
,  [28].
  [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
 both be positive. Let  be the gcd of
 be the gcd of  and
 and  for
 for  . The equation
. The equation  has a solution if and only if
 has a solution if and only if  divides
 divides  . When
. When  dived
 dived  , the equation has exactly
, the equation has exactly  solutions in modulus
 solutions in modulus  . [12]
. [12]
Theorem:
Let  be the gcd of positive integers
 be the gcd of positive integers  and
 and  . The congruence
. The congruence  has a solution if and only if
 has a solution if and only if  divides
 divides  . When this is the case, the solutions are the integers in exactly
. When this is the case, the solutions are the integers in exactly  distinct classes modulus
 distinct classes modulus  .[12]
.[12]
Example:
Describe all solutions of the given congruence, 
Firstly we can simplify  , we know that
, we know that  fits into
 fits into  once so if we subtract
 once so if we subtract  from
 from  we should get the remainder
 we should get the remainder  . Thus we can rewrite our congruence as
. Thus we can rewrite our congruence as  now let
 now let  we know
 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
 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
 and  , since 12 cannot divide 15 we conclude that there are no solutions for
, 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.
