CalculatorWallah logoCalculatorWallah

Relatively Prime Calculator

Check whether integers are relatively prime or coprime with GCD tests, pairwise checks, Euclidean algorithm steps, and prime factorization.

Last Updated: May 2026

Collectively relatively prime?

Yes

Pairwise relatively prime?

Yes

GCD / GCF

1

LCM

2,240

Relatively Prime Inputs

Enter two or more integers. The calculator reports the shared GCD and checks whether the whole set, and every pair, is relatively prime.

Prime Status

MeasureValueMeaning
Normalized inputs35, 64Absolute values are used for gcd checks.
GCD / GCF1Relatively prime means this value is 1.
Collective testPassThe full set has no common divisor greater than 1.
Pairwise testPassEvery two-number pair has gcd 1.
Zero handlingNo zero inputsStandard integer gcd rules apply.

Pairwise Checks

PairGCDVerdict
35 and 64gcd = 1Relatively prime

Euclidean Algorithm

DivisionNext stepVerdict
64 = 35 x 1 + 29Continue with 35 and 29.Keep going
35 = 29 x 1 + 6Continue with 29 and 6.Keep going
29 = 6 x 4 + 5Continue with 6 and 5.Keep going
6 = 5 x 1 + 1Continue with 5 and 1.Keep going
5 = 1 x 5 + 01 is the gcd.Relatively prime

Shared Factor Witnesses

PairGCDVerdict
No shared pair factorEvery displayed pair has gcd 1Pairwise relatively prime

Prime Factors

InputPrime factorization
355 x 7
642^6

Integer Arithmetic Notice

This calculator checks integer relative primality. Decimal, fraction, and algebraic expressions should be converted to integers before use.

Reviewed For Methodology, Labels, And Sources

Every CalculatorWallah calculator is published with visible update labeling, linked source references, and review of formula clarity on trust-sensitive topics. Use results as planning support, then verify institution-, policy-, or jurisdiction-specific rules where they apply.

Reviewed By

Jitendra Kumar, Founder & Editorial Standards Lead, reviews methodology, labels, assumptions, and trust-sensitive publishing decisions for this topic area.

Review editor profile

Topic Ownership

Sales tax and tax-sensitive estimate tools, Education and GPA planning calculators, Health, protein, and screening-formula pages, Platform-wide publishing standards and methodology

See ownership standards

Methodology & Updates

Page updated May 2026. Trust-critical pages are reviewed when official rates or rules change. Evergreen calculator guides are checked on a recurring quarterly or annual cycle depending on topic volatility.

How to Use the Relatively Prime Calculator

Enter two or more integers separated by commas, spaces, semicolons, or new lines. The calculator normalizes negative values to absolute values before checking shared factors.

Read the collective verdict first, then inspect the pairwise table if you entered more than two values. The Euclidean algorithm table shows why the first pair passes or fails.

  1. Step 1: Enter integers

    Use values such as 35, 64 or a set such as 6, 10, 15.

  2. Step 2: Check the GCD

    The numbers are relatively prime when the greatest common divisor is 1.

  3. Step 3: Review pairwise status

    For sets, pairwise relatively prime means every two-number pair has gcd 1.

  4. Step 4: Use the proof rows

    Use Euclidean steps and prime factors to see exactly where shared factors appear.

How This Relatively Prime Calculator Works

The calculator parses valid integers and takes their absolute values. It then computes the greatest common divisor with the Euclidean algorithm.

For two numbers, gcd equal to 1 is exactly the relatively prime test. For three or more numbers, the calculator also tests every pair so you can distinguish collective and pairwise relative primality.

Prime factorization is included for smaller inputs because shared prime factors are the reason the gcd becomes greater than 1.

Relatively Prime Guide

Relatively Prime Rules

ConceptTestMeaning
Two integersgcd(a, b) = 1The pair is relatively prime or coprime.
Shared factorgcd(42, 56) = 14Not relatively prime.
Collective setgcd(6, 10, 15) = 1The whole set is collectively relatively prime.
Pairwise setEvery pair has gcd 1Stronger than collective relative primality.
Prime factorsNo common prime factorEquivalent to gcd 1.
Zero casegcd(0, n) = |n|Zero is relatively prime only with 1 or -1.

Worked Examples

InputVerdictReason
35 and 64Relatively primegcd(35, 64) = 1.
42 and 56Not relatively primeThey share factor 14.
14, 25, 81Pairwise relatively primeEvery pair has gcd 1.
6, 10, 15Collectively but not pairwiseThe full gcd is 1, but each pair shares a factor.
0 and 1Relatively primegcd(0, 1) = 1.

Why Pairwise Is Stronger

The set 6, 10, and 15 has gcd 1, so it is collectively relatively prime. But it is not pairwise relatively prime because gcd(6, 10) = 2, gcd(6, 15) = 3, and gcd(10, 15) = 5. Pairwise relative primality requires every pair to pass.

Keep the research moving with GCF Calculator, LCM / GCF Calculator, Prime Factorization Calculator, and Prime Number Calculator.

Frequently Asked Questions

Integers are relatively prime, or coprime, when their greatest common divisor is 1.

A set is collectively relatively prime when the gcd of all values is 1. It is pairwise relatively prime when every two-number pair has gcd 1.

Yes. For example, 35 and 64 are both composite, but they are relatively prime because they share no factor greater than 1.

Distinct prime numbers are relatively prime to each other, but a prime number is not relatively prime to a multiple of itself.

Zero is relatively prime only with 1 or -1 because gcd(0, n) equals the absolute value of n.

The Euclidean algorithm finds the gcd quickly by repeated division. If the final gcd is 1, the numbers are relatively prime.

Related Calculators

Sources & References

  1. 1.Wolfram MathWorld - Relatively Prime(Accessed May 2026)
  2. 2.Wolfram MathWorld - Euclidean Algorithm(Accessed May 2026)
  3. 3.OpenStax Prealgebra 2e - Prime Factorization and Greatest Common Factor(Accessed May 2026)