(b)
First method: using prime factorizations.
Determine the greatest common divisor by determining the prime factorization of each integer.
If the prime factorizations are and with prime numbers, non-negative integers, then the greatest common divisor of are:
Obviously, this method will work best when the prime factorizations have been given or when the integers are small and easy to factorize.
Second method: Euclidean algorithm.
Determine the greatest common divisor by using until
with that and this would then imply .
This method is best used when the integers are large and hard to factorize.
Third method: Exhaustive method.
Determine all divisors of the two integers a and b. Their greatest common divisor is then the largest possible integer q such that q divides a and q divides b.
This method is the least effective and only works best when both integers are prime numbers (as then we know that the greatest common divisor is 1 ).