# Relatively Prime Calculator

URL: https://speedycalculator.com/calculators/math/relatively-prime/
Last updated: 2026-11-08

> The relatively prime calculator checks whether two or more whole numbers are coprime (share no factor except 1), and for sets whether they are pairwise coprime.

## Inputs

- Numbers (2 to 10)

## Results

- Result
- GCF of all numbers
- Pairs that share a factor

## Formula

```
a and b are coprime ⇔ gcd(a, b) = 1
```

## Explanation

Coprime numbers appear in fraction simplification (a fraction is in lowest terms when numerator and denominator are coprime), gear design, the Chinese remainder theorem and RSA key generation.

### How to use the Relatively Prime Calculator

- **Numbers (2 to 10)**

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

### How it works

For a pair the calculator computes the greatest common factor. For a set it checks the overall gcd (relatively prime) and every pair separately (pairwise coprime).

## Worked example

Inputs: Numbers (2 to 10): 8, 9, 25.

Results: **Result = Pairwise coprime**; GCF of all numbers = 1; Pairs that share a factor = Every pair has GCF 1..

## Key terms

- **Coprime**: Having greatest common factor 1.

## FAQ

**Are 8 and 9 coprime?**
Yes. Neither is prime, but they share no factor.

**Is 1 coprime to every number?**
Yes.

**What is the difference between relatively prime and pairwise coprime?**
{6, 10, 15} has gcd 1 overall but every pair shares a factor.

**Are two consecutive integers coprime?**
Always.


## Sources

- [Wolfram MathWorld: Relatively prime](https://mathworld.wolfram.com/RelativelyPrime.html)
- [OpenStax: Contemporary Mathematics](https://openstax.org/details/books/contemporary-mathematics)
