Relatively Prime: gcd(a,b) = 1
Two numbers are coprime (relatively prime) if gcd(a,b)=1. No common prime factors. Euler totient ฯ(n) counts integers 1..n-1 coprime to n.
Did our AI summary help? Let us know.
gcd(a,b)=1 โ no common prime factors. 8 and 9 are coprime. ฯ(p)=p-1 for prime p. ฯ(10)=4 (1,3,7,9). Euclidean algorithm: gcd(a,b)=gcd(b, a mod b).
Ready to run the numbers?
Why: Coprime numbers share no common factors. Used in RSA (e and ฯ(n) must be coprime), fractions in lowest terms, and the Chinese remainder theorem.
How: Compute gcd(a,b). If gcd=1, they are coprime. Euclidean algorithm: gcd(a,b)=gcd(b, a mod b). For ฯ(n): count integers in 1..n-1 with gcd(k,n)=1.
Run the calculator when you are ready.
Enter Numbers
Input Values
Result
๐ Step-by-Step Breakdown
For educational and informational purposes only. Verify with a qualified professional.
๐งฎ Fascinating Math Facts
Coprime: gcd(a,b)=1
โ Definition
ฯ(n) = count coprime to n
โ Euler totient
๐ Key Takeaways
- โข Relatively prime (coprime): GCD(a, b, ...) = 1 โ no common factors except 1
- โข Euclidean algorithm: gcd(a,b) = gcd(b, a mod b). Efficient O(log n)
- โข Euler totient ฯ(n): count of integers 1 to n coprime to n
- โข Consecutive integers are always coprime: gcd(n, n+1) = 1
- โข Two distinct primes are always coprime
๐ก Did You Know?
๐ How It Works
Enter two or more integers. The calculator finds their GCD using the Euclidean algorithm: gcd(a,b) = gcd(b, a mod b), repeated until the remainder is 0. If GCD = 1, the numbers are relatively prime (coprime). Euler totient ฯ(n) counts integers from 1 to n that are coprime to n. For prime p: ฯ(p) = pโ1.
๐ Worked Example: 15 and 28
Euclidean algorithm:
28 = 1 ร 15 + 13 โ gcd(15, 13)
15 = 1 ร 13 + 2 โ gcd(13, 2)
13 = 6 ร 2 + 1 โ gcd(2, 1)
2 = 2 ร 1 + 0 โ gcd(1, 0) = 1
15 and 28 are coprime.
Prime factors: 15=3ร5, 28=4ร7. No shared primes. โ
๐ Real-World Applications
๐ RSA Cryptography
Keys use coprime e and ฯ(n). Security relies on gcd.
๐ Fractions
Lowest terms: gcd(num, den)=1. 12/35 already reduced.
๐ Chinese Remainder
CRT requires coprime moduli for unique solution.
๐ฒ Random Numbers
Linear congruential generators use coprime modulus.
๐ฌ Music Theory
Coprime periods in rhythm: no sync until LCM.
๐ป Hash Tables
Table size coprime to step size for full coverage.
โ ๏ธ Common Mistakes to Avoid
- Confusing coprime with prime: Coprime = gcd(a,b)=1. Prime = number with 2 divisors.
- Stopping Euclidean too early: Continue until remainder is 0. Last non-zero = GCD.
- Negative numbers: GCD uses absolute values. gcd(-15, 28) = gcd(15, 28) = 1.
- Three or more: gcd(a,b,c)=1 means all are coprime as a set. gcd(gcd(a,b),c)=1.
- ฯ(1) = 1: 1 is coprime to itself. ฯ(1)=1 by convention.
๐ฏ Expert Tips
๐ก Euclidean Algorithm
gcd(a,b) = gcd(b, a mod b). Repeat until b=0. Then gcd=a.
๐ก Multiple Numbers
gcd(a,b,c) = gcd(gcd(a,b), c). Apply pairwise.
๐ก Prime Factors
Coprime = no shared prime factors. 15=3ร5, 28=4ร7 โ no overlap.
๐ก Bรฉzout
If gcd(a,b)=1, then ax+by=1 for some integers x,y. Extended Euclidean finds them.
๐ Reference Table
| Concept | Definition |
|---|---|
| Coprime | gcd(a,b) = 1 |
| Euclidean | gcd(a,b) = gcd(b, a mod b) |
| Euler ฯ(n) | Count of 1..n coprime to n |
| ฯ(p) for prime | ฯ(p) = p โ 1 |
| Consecutive | gcd(n, n+1) = 1 |
๐ Quick Reference
๐ Practice Problems
โ FAQ
What does relatively prime mean?
Numbers with GCD = 1. No common factors except 1. Also called coprime.
Are 15 and 28 coprime?
Yes. 15=3ร5, 28=4ร7. No shared primes. GCD=1.
What is Euler totient?
ฯ(n) = number of integers 1 to n that are coprime to n. ฯ(12)=4 (1,5,7,11).
How does Euclidean algorithm work?
gcd(a,b)=gcd(b,a mod b). Repeat until b=0. Then gcd=a.
Applications?
Cryptography (RSA), fractions in lowest terms, Chinese Remainder Theorem.
Consecutive integers?
Any two consecutive integers (n, n+1) are always coprime.
Three or more numbers?
gcd(a,b,c)=gcd(gcd(a,b),c). If result is 1, the set is coprime.
๐ Summary
Relatively prime (coprime) means GCD = 1. Use the Euclidean algorithm to find GCD efficiently. Euler totient ฯ(n) counts coprimes to n. Essential for cryptography, fractions, and number theory.
โ Verification Tip
For coprime: gcd should be 1. Check prime factors: no overlap. For ฯ(n): list 1..n, count those with gcd(k,n)=1.
๐ Next Steps
Explore the GCF Calculator for greatest common divisor. The Prime Number Calculator checks primality. The Chinese Remainder Theorem uses coprime moduli.
โ ๏ธ Disclaimer: For educational use. Integer inputs only.
Related Calculators
GCF Calculator
Find the greatest common factor (GCF/GCD) of two or more positive integers. Uses Euclidean algorithm with step-by-step breakdown. Prime factorization method...
MathematicsExtended Euclidean Algorithm Calculator
Find gcd(a,b) and Bรฉzout coefficients x, y such that ax + by = gcd(a,b). Step-by-step division table. Modular inverse, linear Diophantine equations.
MathematicsMultiplicative Inverse Modulo Calculator
Find the multiplicative inverse of a modulo m: aรx โก 1 (mod m). Uses the Extended Euclidean Algorithm with step-by-step trace. Applications in cryptography (RSA, Diffie-Hellman), linear congruences, and Chinese Remainder Theorem. Verify with Fermat's Little Theorem for prime moduli.
MathematicsRoot Mean Square Calculator
Calculate RMS = sqrt(mean of xยฒ). AC voltage equivalent, compare with arithmetic mean. Step-by-step for statistics and signal processing.
MathematicsChinese Remainder Theorem Calculator
Solve systems of congruence equations x โก a_i (mod m_i) using the Chinese Remainder Theorem. Step-by-step solution with multiple moduli, modular inverse, and...
MathematicsConsecutive Integers Calculator
Find n consecutive integers that sum to a target, or compute sum and product of consecutive integers. Supports even and odd consecutive sequences....
Mathematics