๐Ÿค Arithmetic Solver

Relatively Prime (Coprime) Calculator - GCD = 1

Determine if two numbers are relatively prime (coprime) by finding their Greatest Common Divisor (GCD).

Two Numbers to Test

Enter values to calculate instant result

๐Ÿ’ก Try:
Verified Solution

---

๐Ÿ“–

How to Use & Educational Guide

In-depth guide for Relatively Prime Calculator

Educational Overview

What Does Relatively Prime (Coprime) Mean?

Two integers $a$ and $b$ are relatively primeโ€”also called coprime or mutually primeโ€”when their only common positive factor is 1. Equivalently, their Greatest Common Divisor (GCD) is equal to 1:

$$\gcd(a, b) = 1 \iff a \text{ and } b \text{ are relatively prime (coprime)}$$

Crucially, two numbers do not need to be prime numbers themselves to be relatively prime. Even two composite numbersโ€”such as 14 and 15โ€”are relatively prime as long as they share no prime factors. Using a relatively prime calculator (or coprime calculator) tests this relationship instantly by computing $\gcd(a, b)$.

How to Check if Two Numbers Are Relatively Prime

You can check whether any two integers are coprime using factor lists, prime factorization, or the Euclidean algorithm:

  1. Write down the two integers ($a$ and $b$): Identify the two whole numbers you want to test.
  2. Find their Greatest Common Divisor ($\gcd(a, b)$): List the positive factors of each number, compare their prime factorizations, or apply the Euclidean division algorithm.
  3. Check if $\gcd(a, b) = 1$: If the greatest common divisor is 1, the numbers are relatively prime. If $\gcd(a, b) > 1$, they share a common divisor and are not relatively prime.

Worked Examples: Coprime vs. Non-Coprime Pairs

Example 1: Are 14 and 15 Relatively Prime?

List all positive factors of both numbers:

  • Factors of 14: 1, 2, 7, 14
  • Factors of 15: 1, 3, 5, 15

Because 1 is the only shared factor ($\gcd(14, 15) = 1$), 14 and 15 are relatively primeโ€”even though both are composite numbers.

Example 2: Are 48 and 65 Relatively Prime? (Euclidean Algorithm)

For larger integers, divide repeatedly and carry each remainder forward until reaching 0:

$$65 = 48(1) + 17 \;\rightarrow\; 48 = 17(2) + 14 \;\rightarrow\; 17 = 14(1) + 3 \;\rightarrow\; 14 = 3(4) + 2 \;\rightarrow\; 3 = 2(1) + \mathbf{1}$$

Because the last non-zero remainder is 1 ($\gcd(48, 65) = 1$), 48 and 65 are relatively prime.

Example 3: Are 12 and 18 Relatively Prime?

The numbers 12 and 18 share common factors 1, 2, 3, and 6, giving $\gcd(12, 18) = 6$. Because their GCD is greater than 1, 12 and 18 are not relatively prime.

Prime Numbers vs. Relatively Prime Numbers

Students often confuse being prime with being relatively prime. Keep these two concepts distinct:

Concept Applies To Definition & Example
Prime Number A single integer ($> 1$) Has exactly two positive factors: 1 and itself (e.g., 7 or 13)
Relatively Prime (Coprime) A pair or group of integers Shares no common positive factor other than 1 ($\gcd = 1$, e.g., 8 and 15 or 18 and 25)

Quick Reference Table: Coprime & Non-Coprime Pairs

Number Pair GCD Status
8 and 15 1 Relatively Prime (Both Composite)
14 and 15 1 Relatively Prime (Consecutive)
18 and 25 1 Relatively Prime (Both Composite)
35 and 64 1 Relatively Prime (Both Composite)
12 and 18 6 Not Relatively Prime
20 and 30 10 Not Relatively Prime

Key Properties & Pairwise Relatively Prime Numbers

  • Consecutive integers are always coprime: Any two adjacent whole numbers (such as $n$ and $n + 1$, like 8 and 9 or 21 and 22) always have $\gcd(n, n + 1) = 1$.
  • 1 is coprime to every integer: Because $\gcd(1, n) = 1$ for any integer $n$, 1 is relatively prime to every whole number.
  • Pairwise relatively prime: A set of three or more integers is pairwise relatively prime if every possible pair in the set has a GCD of 1โ€”for example, 5, 8, and 9 are pairwise coprime because $\gcd(5,8)=1$, $\gcd(5,9)=1$, and $\gcd(8,9)=1$. (Note: 6, 10, and 15 have an overall GCD of 1, yet are not pairwise coprime because $\gcd(6,10)=2$.)
  • Simplifying fractions to lowest terms: A fraction $\frac{a}{b}$ is completely simplified if and only if $a$ and $b$ are relatively prime (for instance, $\frac{12}{18}$ reduces to $\frac{2}{3}$, where $\gcd(2, 3) = 1$).

Common Mistakes to Avoid

  • Assuming both numbers must be prime: Composite numbers like $9$ ($3^2$) and $16$ ($2^4$) share zero prime factors and are completely relatively prime.
  • Confusing mutually coprime sets with pairwise coprime sets: Always check every pair individually when testing three or more numbers.
  • Forgetting that even numbers are never coprime to each other: Any two even integers share at least the common factor 2, so their GCD is always $\ge 2$.

How to Use the AptCalc Relatively Prime Calculator

  1. Enter two positive integers into the input boxes above.
  2. Click calculate to instantly see whether the numbers are Relatively Prime (Coprime), along with their exact Greatest Common Divisor ($\gcd$), individual factor lists, and prime factorizations.

Mathematical accuracy verified by AptCalc Engine

Frequently Asked Questions (FAQs)

Answers to common questions about this calculator

What does relatively prime (coprime) mean?
Two integers are relatively prime (also called coprime or mutually prime) when their only common positive factor is 1โ€”meaning their Greatest Common Divisor (GCD) is equal to 1.
Do two numbers have to be prime to be relatively prime?
No. Two composite numbers can be relatively prime as long as they share no prime factors. For example, 14 (2 ร— 7) and 15 (3 ร— 5) are both composite, yet gcd(14, 15) = 1, so they are relatively prime.
How do you check if two numbers are relatively prime?
Calculate the Greatest Common Divisor (GCD) of the two numbers. If gcd(a, b) = 1, the numbers are relatively prime; if the GCD is greater than 1, they are not.
Are consecutive numbers always relatively prime?
Yes. Any two consecutive integers n and n + 1 always have a GCD of 1 and are therefore always relatively prime (for example, 8 and 9, or 14 and 15).
Are 12 and 18 relatively prime?
No. Because 12 and 18 share the common factors 2, 3, and 6, their GCD is 6 (greater than 1), so they are not relatively prime.
Explore More Tools

Discover Other Calculation Suites

Browse our full ecosystem of precision calculation and conversion tools