What Is the Greatest Common Divisor of Prime Numbers?
At a glance
- 1. Compare the primes
Check whether the prime numbers are equal or distinct.
- 2. Use prime divisors
A prime has only two positive divisors: 1 and itself.
- 3. State the gcd
Distinct primes have gcd 1; equal primes have gcd equal to that prime.
The greatest common divisor depends on whether the prime numbers are distinct. Two different primes have no common positive divisor other than 1, so their greatest common divisor is 1. If the two numbers are the same prime, that prime divides both and is their greatest common divisor.
The rule for two primes
Let and be prime numbers. Then
A prime number has exactly two positive divisors: 1 and itself. If and are distinct, they cannot share a prime divisor: the only prime divisor of is , and the only prime divisor of is . Since those are different, their only common positive divisor is 1.
If , the two numbers are identical. Their common divisors include both 1 and , and no positive divisor of is larger than . Therefore the gcd is .
Worked examples
Different primes: Find . The positive divisors of 7 are 1 and 7; those of 19 are 1 and 19. The only common divisor is 1, so
The same prime: Find . Both numbers are 13, so 13 is their largest common positive divisor:
The phrase “the gcd of prime numbers” can refer either to distinct primes or to a list that might repeat a prime. Check whether the values are distinct before automatically answering 1.
More than two primes
For a finite list of prime numbers, the same idea applies. If every entry is the same prime , the gcd is . If the list contains at least two different primes, its gcd is 1: any common divisor greater than 1 would have a prime divisor, and that prime would have to divide every number in the list. But distinct primes have no prime divisor in common.
For example,
Repeated values do not change the rule; what matters is whether all the primes in the list are identical.
Common mistakes
- Assuming the gcd is always 1: This is true for two distinct primes, but not for a prime paired with itself. For example, .
- Confusing gcd with the product: The product of distinct primes is not their gcd. For 5 and 11, the product is 55, but the gcd is 1.
- Mixing up gcd and least common multiple: For distinct primes, the gcd is 1 and the least common multiple is their product. For example, and .
- Treating 1 as a prime: Under the standard definition, 1 is not prime. It is the gcd of any two distinct primes, not one of the primes in such a pair.
The key check is simply whether the prime numbers are equal: equal primes have gcd equal to that prime; distinct primes have gcd 1.
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.