The Greatest Common Divisor (PTS) of two integers, also called the Greatest Common Factor (GCF), is the largest integer that is the divisor (factor) of both numbers. For example, the largest number that can divide both 20 and 16 is 4. (Both 16 and 20 have greater factors, but no greater equal factor – for example, 8 is a factor of 16, but not a factor of 20.) In elementary school, most people are taught the guess-and-check method of finding the GCF. However, there is a simpler and more systematic way of doing it that always gives the correct answer. This method is called Euclid's algorithm. If you really want to know how to find the Greatest Common Factor of two integers, take a look at step 1 to get started.
Step
Method 1 of 2: Using the Divisor Algorithm
Step 1. Eliminate all negative signs
Step 2. Know your vocabulary:
when you divide 32 by 5,
-
- 32 is a number that is divided by
- 5 is the divisor of
- 6 is the quotient
- 2 is the remainder (or modulo).
Step 3. Identify the number that is greater than the two numbers
The larger number will be the number that is divided, and the smaller will be the divisor.
Step 4. Write down this algorithm:
(divided number) = (divisor) * (quote) + (remainder)
Step 5. Put the larger number in the place of the divisible number, and the smaller number as the divisor
Step 6. Determine what is the result of dividing the larger number by the smaller number, and enter the result as the quotient
Step 7. Calculate the remainder, and enter it into the appropriate place in the algorithm
Step 8. Rewrite the algorithm, but this time A) use the old divisor as the divisor and B) use the remainder as the divisor
Step 9. Repeat the previous step until the remainder is zero
Step 10. The last divisor is the same greatest divisor
Step 11. Here's an example, where we try to find the GCF of 108 and 30:
Step 12. Notice how the 30 and 18 in the first row switch positions to create the second row
Then, 18 and 12 switch positions to create the third row, and 12 and 6 switch positions to create the fourth row. 3, 1, 1, and 2 following the multiplication sign do not reappear. This number represents the result of dividing the number divided by the divisor, so that each row is different.
Method 2 of 2: Using Prime Factors
Step 1. Eliminate any negative signs
Step 2. Find the prime factorization of the numbers, and write the list as shown below
-
Using 24 and 18 as examples of numbers:
- 24- 2 x 2 x 2 x 3
- 18- 2 x 3 x 3
-
Using 50 and 35 as an example number:
- 50- 2 x 5 x 5
- 35- 5 x 7
Step 3. Identify all the prime factors that are equal
-
Using 24 and 18 as examples of numbers:
-
24-
Step 2. x 2 x 2
Step 3.
-
18-
Step 2
Step 3. x 3
-
-
Using 50 and 35 as an example number:
-
50- 2 x
Step 5. x 5
-
35-
Step 5. x 7
-
Step 4. Multiply the factors by the same
-
In questions 24 and 18, multiply
Step 2. da
Step 3. to get
Step 6.. Six is the greatest common factor of 24 and 18.
-
In examples 50 and 35, neither number can be multiplied.
Step 5. is the only factor in common, and as such is the largest factor.
Step 5. Done
Tips
- One way to write this, using the notation mod = remainder, is GCF(a, b) = b, if a mod b = 0, and GCF(a, b) = GCF(b, a mod b) otherwise.
- For example, find the GCF (-77, 91). First, we use 77 instead of -77, so GCF(-77, 91) becomes GCF(77, 91). Now, 77 is less than 91, so we'll have to swap them out, but let's see how the algorithm gets around those things if we can't. When we calculate 77 mod 91, we get 77 (because 77 = 91 x 0 + 77). Since the result is not zero, we swap (a, b) to (b, a mod b), and the result is: GCF(77, 91) = GCF(91, 77). 91 mod 77 yields 14 (remember, that means 14 is useless). Since the remainder is not zero, convert GCF(91, 88) to GCF(77, 14). 77 mod 14 returns 7, which is not zero, so swap GCF(77, 14) to GCF(14, 7). 14 mod 7 is zero, so 14 = 7 * 2 with no remainder, so we stop. And that means: GCF(-77, 91) = 7.
- This technique is especially useful when simplifying fractions. From the example above, the fraction -77/91 simplifies to -11/13 because 7 is the largest equal divisor of -77 and 91.
- If 'a' and 'b' are zero, then no nonzero number divides them, so technically no greatest divisor is the same in the problem. Mathematicians often just say that the greatest common divisor of 0 and 0 is 0, and that's the answer they get this way.