Coprime integers

In number theory, two integers a and b are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1.

This is equivalent to their greatest common divisor (GCD) being 1.

The numerator and denominator of a reduced fraction are coprime, by definition.

When the integers a and b are coprime, the standard way of expressing this fact in mathematical notation is to indicate that their greatest common divisor is one, by the formula gcd(a, b) = 1 or (a, b) = 1.

In their 1989 textbook Concrete Mathematics, Ronald Graham, Donald Knuth, and Oren Patashnik proposed an alternative notation

The number of integers coprime with a positive integer n, between 1 and n, is given by Euler's totient function, also known as Euler's phi function, φ(n).

A set of integers can also be called coprime if its elements share no common positive factor except 1.

A stronger condition on a set of integers is pairwise coprime, which means that a and b are coprime for every pair (a, b) of different integers in the set.

A number of conditions are equivalent to a and b being coprime: As a consequence of the third point, if a and b are coprime and br ≡ bs (mod a), then r ≡ s (mod a).

Furthermore, if b1, b2 are both coprime with a, then so is their product b1b2 (i.e., modulo a it is a product of invertible elements, and therefore invertible);[6] this also follows from the first point by Euclid's lemma, which states that if a prime number p divides a product bc, then p divides at least one of the factors b, c. As a consequence of the first point, if a and b are coprime, then so are any powers ak and bm.

The two integers a and b are coprime if and only if the point with coordinates (a, b) in a Cartesian coordinate system would be "visible" via an unobstructed line of sight from the origin (0, 0), in the sense that there is no point with integer coordinates anywhere on the line segment between the origin and (a, b).

[8] As a generalization of this, following easily from the Euclidean algorithm in base n > 1: A set of integers

The concept of pairwise coprimality is important as a hypothesis in many results in number theory, such as the Chinese remainder theorem.

It is possible for an infinite set of integers to be pairwise coprime.

Two ideals A and B in a commutative ring R are called coprime (or comaximal) if

This generalizes Bézout's identity: with this definition, two principal ideals (a) and (b) in the ring of integers ⁠

Given two randomly chosen integers a and b, it is reasonable to ask how likely it is that a and b are coprime.

In this determination, it is convenient to use the characterization that a and b are coprime if and only if no prime number divides both of them (see Fundamental theorem of arithmetic).

Informally, the probability that any number is divisible by a prime (or in fact any integer) p is ⁠

⁠ Any finite collection of divisibility events associated to distinct primes is mutually independent.

⁠ If one makes the heuristic assumption that such reasoning can be extended to infinitely many divisibility events, one is led to guess that the probability that two numbers are coprime is given by a product over all primes, Here ζ refers to the Riemann zeta function, the identity relating the product over primes to ζ(2) is an example of an Euler product, and the evaluation of ζ(2) as π2/6 is the Basel problem, solved by Leonhard Euler in 1735.

For each positive integer N, let PN be the probability that two randomly chosen numbers in

Although PN will never equal 6/π2 exactly, with work[9] one can show that in the limit as

More generally, the probability of k randomly chosen integers being setwise coprime is ⁠

[11] The children of each vertex (m, n) are generated as follows: This scheme is exhaustive and non-redundant with no invalid members.

depending on which of them yields a positive coprime pair with m > n. Since only one does, the tree is non-redundant.

Since by this procedure one is bound to arrive at the root, the tree is exhaustive.

In machine design, an even, uniform gear wear is achieved by choosing the tooth counts of the two gears meshing together to be relatively prime.

In pre-computer cryptography, some Vernam cipher machines combined several loops of key tape of different lengths.

Such combinations work best when the entire set of lengths are pairwise coprime.

Figure 1. The numbers 4 and 9 are coprime. Therefore, the diagonal of a 4 × 9 lattice does not intersect any other lattice points
The tree rooted at (2, 1). The root (2, 1) is marked red, its three children are shown in orange, third generation is yellow, and so on in the rainbow order.