SOLVETUTORMATH SOLVER

Instrument MI-01-496 · Mathematics

Relatively Prime Calculator

Two numbers don't have to be prime to be relatively prime — they only need to share no common factor beyond 1. Enter a and b and let gcd(a, b) settle it.

Instrument MI-01-496
Sheet 1 OF 1
Rev A
Verified
Type 05 — Algebra SER. 2026-01496

gcd(a, b) — 1 means relatively prime

1

gcd(a, b)

The working Every figure verified twice
  1. gcdValue = gcd(8, 15) = 1
Worksheet log
  1. No entries yet — change an input to log a scenario.

How this instrument works

Relatively prime — also called coprime — names the relationship between two whole numbers, not something either number holds on its own: a and b are relatively prime exactly when gcd(a, b) = 1, meaning no whole number greater than 1 divides both. The name is easy to misread as being about primality, but it isn't; it only asks whether the pair shares any factor, and the test this sheet runs is the ordinary gcd computation, read for one outcome — did it land on 1 or not.

This test reduces to prime factorizations even when neither factorization is obvious at first glance: gcd(a, b) equals the product of every prime shared by both factorizations, taken to the lower of the two powers each carries. If the two prime lists have nothing in common, that product is empty and gcd(a, b) collapses to 1 — which is exactly why two composite numbers can still be coprime with each other. 8 = 2³ and 15 = 3 × 5 share no prime between them, so nothing survives the overlap, however many factors each number carries on its own.

One consequence surprises most people the first time they see it: any two consecutive whole numbers are automatically coprime, no matter how large. Any common divisor of n and n + 1 would have to divide their difference too, and that difference is always exactly 1 — so 100 and 101 are just as coprime as 2 and 3. This same idea shows up outside arithmetic too: gear designers often pick tooth counts that are coprime, a 'hunting tooth' pairing that forces every tooth to eventually mesh with every other tooth rather than the same pair grinding together each rotation.

gcd(a,b)=1    a and b are relatively prime\gcd(a,b) = 1 \iff a \text{ and } b \text{ are relatively prime}
a, b — the two whole numbers entered · gcd(a, b) — greatest common divisor, the largest whole number dividing both exactly; relative primality holds exactly when this equals 1.
  • Enter your first whole number into a.
  • Enter your second whole number into b — order doesn't matter, since gcd is symmetric.
  • Read gcd(a, b) — 1 means relatively prime: an exact 1 confirms a and b are coprime.
  • Any value above 1 in that same field names the largest factor a and b actually share, so the pair is not coprime.

Worked example — testing 8 and 15

Set a to 8 and b to 15. Factor each one and neither is prime — 8 breaks down as 2³ and 15 breaks down as 3 × 5 — but the two factorizations share no prime at all, so gcd(8, 15) lands on exactly 1 and gcdValue reads 1 on this sheet: 8 and 15 are coprime.

That 1 pays off directly: the fraction 8⁄15 is already in its lowest possible terms, because any factor that could cancel from numerator and denominator alike would have to divide both 8 and 15, and the gcd test just showed none exists beyond 1. Contrast this with 8 and 12, whose gcd of 4 means 8⁄12 still reduces, down to 2⁄3.

Questions

What does it mean for two numbers to be relatively prime?

It means their greatest common divisor is exactly 1 — no whole number bigger than 1 divides both. Coprime is the equivalent term, and neither number needs to be prime for it to apply: 8 and 15 are coprime even though 8 = 2³ and 15 = 3 × 5 are both composite, because their prime factorizations share nothing.

Do relatively prime numbers have to be prime numbers themselves?

No — that's the most common mix-up. Primality belongs to one number; relative primality is the relationship between two. 8 and 15 are coprime despite neither being prime, while 6 and 9 are both composite and not coprime, since they share the factor 3. Only the shared factors between the pair matter, not whether either number alone is prime.

Are any two consecutive integers always relatively prime?

Yes, without exception. Any common divisor of n and n + 1 must also divide their difference, which is always 1, so no factor bigger than 1 can divide both — gcd(n, n + 1) = 1 for every whole number n. Try 100 and 101, or 8 and 9: the gcd comes back 1 every time, however large the numbers get.

Why does relative primality matter for fractions?

Any fraction a⁄b is in lowest terms exactly when a and b are relatively prime — any shared factor could still be cancelled otherwise. Testing gcd(a, b) shows whether more cancelling is possible: 8⁄15 stops there because gcd(8, 15) = 1, while 8⁄12 still simplifies because gcd(8, 12) = 4.

Where does relative primality show up outside of fractions?

Gear design is one classic case: engineers often choose tooth counts for meshing gears that are coprime, known as the 'hunting tooth' arrangement, so every tooth on one gear eventually meets every tooth on the other, spreading wear evenly instead of the same pairs grinding together each cycle. Cryptographic systems such as RSA also depend on choosing coprime numbers to build keys invertible under modular arithmetic.

How does relative primality relate to Euler's totient function?

Euler's totient function, written φ(n), counts exactly how many whole numbers from 1 to n are relatively prime to n. For n = 15, φ(15) = 8, tallying {1, 2, 4, 7, 8, 11, 13, 14} — the same gcd-equals-1 relationship this sheet checks for one pair, totalled across every number below n at once.