Introduction
Two numbers can be relatively prime even when both are composite. The phrase does not describe whether each number is prime on its own; it describes the relationship between the two numbers. If their only shared positive factor is 1, they are relatively prime. For example, 8 and 15 meet this condition, although each has factors other than 1 and itself. Understanding this distinction makes it easier to work with fractions, divisibility, and number patterns.
- What “relatively prime” means
- Why neither number needs to be prime
- Prime factors reveal the relationship
- How to check whether two numbers are relatively prime
- Common misunderstandings
- Special cases: 1, equal numbers, and negative values
- Relatively prime pairs and fractions
- Where the idea appears in mathematics
- Conclusion
What “relatively prime” means
Two whole numbers are relatively prime, or coprime, when their greatest common divisor is 1. The greatest common divisor, often shortened to GCD, is the largest positive whole number that divides each number without leaving a remainder. If the GCD is 1, there is no shared positive factor larger than 1.
For example, the factors of 8 are 1, 2, 4, and 8. The factors of 15 are 1, 3, 5, and 15. Their only common factor is 1, so their GCD is 1 and they are relatively prime.
Now compare 8 and 12. The factors of 8 include 1, 2, 4, and 8; the factors of 12 include 1, 2, 3, 4, 6, and 12. They share 2 and 4, so their GCD is 4. They are not relatively prime.
The word “relatively” is important. It signals that coprimality is a comparison between numbers. A number is prime or composite by itself, but two numbers are relatively prime in relation to each other.
Why neither number needs to be prime
A prime number has exactly two positive divisors: 1 and the number itself. A composite number is a whole number greater than 1 that has additional positive divisors. Relative primality asks a different question: do the two numbers share any factor greater than 1?
Consider 14 and 25. Both are composite: 14 equals 2 × 7, while 25 equals 5 × 5. Their prime factors are different, so they have no shared factor greater than 1. Their GCD is 1, and the numbers are relatively prime.
Another example is 9 and 16. Since 9 equals 3 × 3 and 16 equals 2 × 2 × 2 × 2, their prime factors do not overlap. They are relatively prime, even though neither is prime.
This can happen because a number may be built from several prime factors, while another number is built from entirely different prime factors. Being composite does not guarantee that a number shares a factor with every other composite number.
Prime factors reveal the relationship
Every whole number greater than 1 can be expressed as a product of primes. This is called its prime factorization. Comparing the prime factorizations of two numbers gives a direct way to see whether they are relatively prime.
For 18 and 35, the factorizations are 18 = 2 × 3 × 3 and 35 = 5 × 7. No prime appears in both factorizations, so the numbers have no common factor greater than 1. They are relatively prime.
For 18 and 42, the factorizations are 18 = 2 × 3 × 3 and 42 = 2 × 3 × 7. The numbers share the prime factors 2 and 3. Their GCD is 6, so they are not relatively prime.
In general, two positive integers greater than 1 are relatively prime exactly when their prime factorizations have no prime factor in common. If even one prime factor appears in both, that prime divides both numbers, and their GCD must be greater than 1.
Repeated factors matter when finding the exact GCD, but not when deciding whether the GCD is 1. For example, 12 = 2 × 2 × 3 and 18 = 2 × 3 × 3 share the primes 2 and 3. The GCD uses the shared factors only to the smaller available powers, giving 2 × 3 = 6.
How to check whether two numbers are relatively prime
For small numbers, listing their factors can work well. Write down the positive factors of each number and identify the ones they share. If the only shared factor is 1, the numbers are relatively prime. This method is easy to understand, but it can become slow when the numbers are large.
Prime factorization is another approach. Break each number into prime factors and look for overlap. This can be convenient for numbers with familiar factorizations, but finding those factorizations may take effort for large values.
A more efficient general method is the Euclidean algorithm. It finds the GCD by repeatedly replacing a pair of numbers with the smaller number and the remainder from dividing the larger by the smaller. The process ends when the remainder is zero; the last nonzero remainder is the GCD.
For example, to check 35 and 64:
64 divided by 35 leaves a remainder of 29.
35 divided by 29 leaves a remainder of 6.
29 divided by 6 leaves a remainder of 5.
6 divided by 5 leaves a remainder of 1.
5 divided by 1 leaves a remainder of 0.
The last nonzero remainder is 1, so the GCD of 35 and 64 is 1. They are relatively prime. The method works without first listing every factor or finding complete prime factorizations.
Common misunderstandings
“Relatively prime” does not mean “both prime.” It means the pair has no common factor greater than 1. The examples 8 and 15, or 14 and 25, show that both numbers can be composite.
Two different numbers are not automatically relatively prime. For instance, 21 and 35 are different, but both are divisible by 7. Their GCD is 7, so they are not relatively prime.
One prime number does not always make a pair relatively prime. A prime number can share a factor with a composite number. For example, 7 and 21 share the factor 7. In contrast, 7 and 20 are relatively prime because 20 is not divisible by 7 and they share no factor greater than 1.
Relatively prime does not mean the numbers have no factors. Every positive whole number has 1 as a factor, and each number has itself as a factor. The condition is that they have no common positive factor other than 1.
Special cases: 1, equal numbers, and negative values
The number 1 is neither prime nor composite. It has only one positive divisor, itself. But 1 is relatively prime to every positive integer, because the only positive factor it can share with another number is 1. For example, the GCD of 1 and 24 is 1.
A number greater than 1 is not relatively prime to itself. The GCD of 15 and 15 is 15, not 1. More generally, two equal positive integers are relatively prime only when both are 1.
Some contexts also discuss negative integers. The usual idea still applies by using the positive GCD: for example, the GCD of −8 and 15 is 1, so they are relatively prime. For introductory purposes, it is often simplest to focus on positive whole numbers unless negative values are specifically included.
Relatively prime pairs and fractions
Coprimality explains when a fraction is in lowest terms. A fraction is in lowest terms when its numerator and denominator have no common factor greater than 1. In other words, their GCD is 1.
The fraction 8/15 is already in lowest terms because 8 and 15 are relatively prime. By contrast, 12/18 can be reduced because the numerator and denominator share a GCD of 6: dividing both by 6 gives 2/3.
This idea is useful even when a fraction does not look complicated. Checking the GCD tells you whether a common whole-number factor can be cancelled. It also helps explain why two equivalent fractions may have different numerators and denominators, while only one form is reduced to lowest terms.
Where the idea appears in mathematics
Relatively prime numbers appear in arithmetic, algebra, and number theory because having no shared factor simplifies many calculations. For example, if a whole number of items is divided into equal groups, the GCD helps identify the largest group size that divides two quantities exactly. When the GCD is 1, there is no larger common whole-number grouping factor.
Coprimality also matters in modular arithmetic, a system that studies remainders after division by a fixed number. A familiar example is the repeating positions on a clock. Certain patterns cycle through all possible positions only when the step size and the number of positions are relatively prime.
For instance, imagine moving around 10 numbered positions by advancing 3 places each time. Since 3 and 10 are relatively prime, repeated moves eventually visit every position before returning to the starting point. If the step were 4, the GCD of 4 and 10 would be 2, and the movement would visit only some positions before repeating. This illustrates how a shared factor can limit a cycle.
These applications do not change the definition. Whether the setting is fractions, divisibility, or remainders, the key test remains the same: find out whether the two numbers have a common factor greater than 1.
Conclusion
Two numbers are relatively prime when their greatest common divisor is 1. That condition concerns their shared factors, not whether either number is prime. Composite numbers such as 8 and 15, or 14 and 25, can be relatively prime because their prime factors do not overlap. Checking a pair’s GCD makes the idea practical and connects it to fractions, divisibility, and repeating number patterns.

