Two integers are relatively prime if they share no common positive factors (divisors) except 1. Using the notation to denote the greatest common divisor, two integers and are relatively prime if . Relatively prime integers are sometimes also called strangers or coprime and are denoted . The plot above plots and along the two axes and colors a square black if and white otherwise (left figure) and simply colored according to (right figure).
Two numbers can be tested to see if they are relatively prime in Mathematica using CoprimeQ[m, n].
Two distinct primes and are always relatively prime, , as are any positive integer powers of distinct primes and , .
Relative primality is not transitive. For example, and , but .
The probability that two integers and picked at random are relatively prime is
Chat with our AI personalities
A number is never relatively prime.Relatively prime refers to a pair of numbers.
It can be. 16 is relatively prime with 25.
13 and 4 are relatively prime.
13 and 24 are relatively prime.
A number cannot be relatively prime number by itself. It can only be relatively prime in the context of (relativeto) another number. That requires the two numbers not to have any prime factors in common.