Relatively Prime (Coprime) Calculator - GCD = 1
Determine if two numbers are relatively prime (coprime) by finding their Greatest Common Divisor (GCD).
---
Visual Graph & Diagram
Interactive mathematical coordinate representation
Calculation Reference Table
Benchmark values and quick reference intervals
How to Calculate Relatively Prime Calculator
Step-by-Step Mathematical Solution & Verification
How to Use & Educational Guide
In-depth guide for Relatively Prime Calculator
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:
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:
- Write down the two integers ($a$ and $b$): Identify the two whole numbers you want to test.
- 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.
- 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:
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 9are pairwise coprime because $\gcd(5,8)=1$, $\gcd(5,9)=1$, and $\gcd(8,9)=1$. (Note:6, 10, and 15have 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
- Enter two positive integers into the input boxes above.
- 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?
Do two numbers have to be prime to be relatively prime?
How do you check if two numbers are relatively prime?
Are consecutive numbers always relatively prime?
Are 12 and 18 relatively prime?
Discover Other Calculation Suites
Browse our full ecosystem of precision calculation and conversion tools
Mathematics Suite
Percentages, Algebra, Fractions, Geometry, and step-by-step math solvers.
Date & Time Tools
Days ago, days from today, business days, and calendar date calculators.
Unit Converter
Convert length, weight, volume, temperature, and international units.
Countdown Tracker
Live real-time event countdowns, holidays, and deadline trackers.
Explore Related Calculators
More tools in Arithmetic
Addition Calculator
Step-By-Step Solver
Subtraction Calculator
Step-By-Step Solver
Multiplication Calculator
Step-By-Step Solver
Division Calculator
Step-By-Step Solver
Long Division Calculator
Step-By-Step Solver
Order of Operations Calculator (PEMDAS/BODMAS)
Step-By-Step Solver