Relatively Prime Checker

Input two numbers to find out if they are relatively prime.

Relatively Prime Check

Result

What Are Relatively Prime Numbers?

Two integers are considered relatively prime if their greatest common divisor (GCD) is 1. This means the numbers share no common factors other than 1. For example, (8, 15) and (9, 28) are pairs of relatively prime numbers.

How to Determine If Two Numbers Are Relatively Prime

  1. Use the Euclidean algorithm or prime factorization to find the GCD of the numbers.
  2. Check if the GCD equals 1. If it does, the numbers are relatively prime.

Examples

Example 1: Are 35 and 72 Relatively Prime?

Solution:

Factors of 35: 1, 5, 7, 35

Factors of 72: 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72

GCD(35, 72) = 1

Result: 35 and 72 are relatively prime.

Example 2: Are 46 and 105 Relatively Prime?

Solution:

Factors of 46: 1, 2, 23, 46

Factors of 105: 1, 3, 5, 7, 15, 21, 35, 105

GCD(46, 105) = 1

Result: 46 and 105 are relatively prime.

Example 3: Are 14 and 28 Relatively Prime?

Solution:

Factors of 14: 1, 2, 7, 14

Factors of 28: 1, 2, 4, 7, 14, 28

GCD(14, 28) = 14

Result: 14 and 28 are not relatively prime.