Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Coprime integers

From Wikipedia, the free encyclopedia
(Redirected fromCoprime)
Two numbers without shared prime factors

Innumber theory, twointegersa andb arecoprime,relatively prime ormutually prime if the only positive integer that is adivisor of both of them is 1.[1] Consequently, anyprime number that dividesa does not divideb, and vice versa. This is equivalent to theirgreatest common divisor (GCD) being 1.[2] One says alsoais prime tob orais coprime withb.

The numbers 8 and 9 are coprime, despite the fact that neither—considered individually—is a prime number, since 1 is their only common divisor. On the other hand, 6 and 9 are not coprime, because they are both divisible by 3. The numerator and denominator of areduced fraction are coprime, by definition.

Notation and testing

[edit]

When the integersa andb are coprime, the standard way of expressing this fact inmathematical notation is to indicate that their greatest common divisor is one, by the formulagcd(a,b) = 1 or(a,b) = 1. In their 1989 textbookConcrete Mathematics,Ronald Graham,Donald Knuth, andOren Patashnik proposed an alternative notationab{\displaystyle a\perp b} to indicate thata andb are relatively prime and that the term "prime" be used instead of coprime (as ina isprime tob).[3]

A fast way to determine whether two numbers are coprime is given by theEuclidean algorithm and its faster variants such asbinary GCD algorithm orLehmer's GCD algorithm.

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

Aset 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 thata andb are coprime for every pair(a,b) of different integers in the set. The set{2, 3, 4} is coprime, but it is not pairwise coprime since 2 and 4 are not relatively prime.

Properties

[edit]

The numbers 1 and −1 are the only integers coprime with every integer, and they are the only integers that are coprime with 0.

A number of conditions are equivalent toa andb being coprime:

As a consequence of the third point, ifa andb are coprime andbrbs (moda), thenrs (moda).[5] That is, we may "divide byb" when working moduloa. Furthermore, ifb1,b2 are both coprime witha, then so is their productb1b2 (i.e., moduloa it is a product of invertible elements, and therefore invertible);[6] this also follows from the first point byEuclid's lemma, which states that if a prime numberp divides a productbc, thenp divides at least one of the factorsb, c.

As a consequence of the first point, ifa andb are coprime, then so are any powersak andbm.

Ifa andb are coprime anda divides the productbc, thena dividesc.[7] This can be viewed as a generalization of Euclid's lemma.

Figure 1. The numbers 4 and 9 are coprime. Therefore, the diagonal of a 4 × 9 lattice does not intersect any otherlattice points

The two integersa andb are coprimeif and only if the point with coordinates(a,b) in aCartesian 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). (See figure 1.)

In a sense that can be made precise, theprobability that two randomly chosen integers are coprime is6/π2, which is about 61% (see§ Probability of coprimality, below).

Twonatural numbersa andb are coprime if and only if the numbers2a − 1 and2b − 1 are coprime.[8] As a generalization of this, following easily from theEuclidean algorithm inbasen > 1:

gcd(na1,nb1)=ngcd(a,b)1.{\displaystyle \gcd \left(n^{a}-1,n^{b}-1\right)=n^{\gcd(a,b)}-1.}

Coprimality in sets

[edit]

Aset of integersS={a1,a2,,an}{\displaystyle S=\{a_{1},a_{2},\dots ,a_{n}\}} can also be calledcoprime orsetwise coprime if thegreatest common divisor of all the elements of the set is 1. For example, the integers 6, 10, 15 are coprime because 1 is the only positive integer that divides all of them.

If every pair in a set of integers is coprime, then the set is said to bepairwise coprime (orpairwise relatively prime,mutually coprime ormutually relatively prime). Pairwise coprimality is a stronger condition than setwise coprimality; every pairwise coprime finite set is also setwise coprime, but the reverse is not true. For example, the integers 4, 5, 6 are (setwise) coprime (because the only positive integer dividingall of them is 1), but they are notpairwise coprime (becausegcd(4, 6) = 2).

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

It is possible for aninfinite set of integers to be pairwise coprime. Notable examples include the set of all prime numbers, the set of elements inSylvester's sequence, and the set of allFermat numbers.

Probability of coprimality

[edit]

Given two randomly chosen integersa andb, it is reasonable to ask how likely it is thata andb are coprime. In this determination, it is convenient to use the characterization thata andb are coprime if and only if no prime number divides both of them (seeFundamental theorem of arithmetic).

Informally, the probability that any number is divisible by a prime (or in fact any integer)p is1p;{\displaystyle {\tfrac {1}{p}};} for example, every 7th integer is divisible by 7. Hence the probability that two numbers are both divisible byp is1p2,{\displaystyle {\tfrac {1}{p^{2}}},} and the probability that at least one of them is not is11p2.{\displaystyle 1-{\tfrac {1}{p^{2}}}.} Any finite collection of divisibility events associated to distinct primes is mutually independent. For example, in the case of two events, a number is divisible by primesp andq if and only if it is divisible bypq; the latter event has probability1pq.{\displaystyle {\tfrac {1}{pq}}.} 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,

prime p(11p2)=(prime p11p2)1=1ζ(2)=6π20.60792710261%.{\displaystyle \prod _{{\text{prime }}p}\left(1-{\frac {1}{p^{2}}}\right)=\left(\prod _{{\text{prime }}p}{\frac {1}{1-p^{-2}}}\right)^{-1}={\frac {1}{\zeta (2)}}={\frac {6}{\pi ^{2}}}\approx 0.607927102\approx 61\%.}

Hereζ refers to theRiemann zeta function, the identity relating the product over primes toζ(2) is an example of anEuler product, and the evaluation ofζ(2) asπ2/6 is theBasel problem, solved byLeonhard Euler in 1735.

There is no way to choose a positive integer at random so that each positive integer occurs with equal probability, but statements about "randomly chosen integers" such as the ones above can be formalized by using the notion ofnatural density. For each positive integerN, letPN be the probability that two randomly chosen numbers in{1,2,,N}{\displaystyle \{1,2,\ldots ,N\}} are coprime. AlthoughPN will never equal6/π2 exactly, with work[9] one can show that in the limit asN,{\displaystyle N\to \infty ,} the probabilityPN approaches6/π2.

More generally, the probability ofk randomly chosen integers being setwise coprime is1ζ(k).{\displaystyle {\tfrac {1}{\zeta (k)}}.}[10]

Generating all coprime pairs

[edit]
Thetree 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.

All pairs of positive coprime numbers(m,n) (withm >n) can be arranged in two disjoint completeternary trees, one tree starting from(2, 1) (for even–odd and odd–even pairs),[11] and the other tree starting from(3, 1) (for odd–odd pairs).[12] The children of each vertex(m,n) are generated as follows:

This scheme is exhaustive and non-redundant with no invalid members. This can be proved by remarking that, if(a,b){\displaystyle (a,b)} is a coprime pair witha>b,{\displaystyle a>b,} then

In all cases(m,n){\displaystyle (m,n)} is a "smaller" coprime pair withm>n.{\displaystyle m>n.} This process of "computing the father" can stop only if eithera=2b{\displaystyle a=2b} ora=3b.{\displaystyle a=3b.} In these cases, coprimality, implies that the pair is either(2,1){\displaystyle (2,1)} or(3,1).{\displaystyle (3,1).}

Another (much simpler) way to generate a tree of positive coprime pairs(m,n) (withm >n) is by means of two generatorsf:(m,n)(m+n,n){\displaystyle f:(m,n)\rightarrow (m+n,n)} andg:(m,n)(m+n,m){\displaystyle g:(m,n)\rightarrow (m+n,m)}, starting with the root(2,1){\displaystyle (2,1)}. The resultingbinary tree, theCalkin–Wilf tree, is exhaustive and non-redundant, which can be seen as follows. Given a coprime pair one recursively appliesf1{\displaystyle f^{-1}} org1{\displaystyle g^{-1}} depending on which of them yields a positive coprime pair withm >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.

Applications

[edit]

In machine design, an even, uniformgear wear is achieved by choosing the tooth counts of the two gears meshing together to be relatively prime. When a 1:1gear ratio is desired, a gear relatively prime to the two equal-size gears may be inserted between them.

In pre-computercryptography, someVernam cipher machines combined several loops of key tape of different lengths. Manyrotor machines combine rotors of different numbers of teeth. Such combinations work best when the entire set of lengths are pairwise coprime.[13][14][15][16]

Generalizations

[edit]
See also:Greatest common divisor § In commutative rings

This concept can be extended to other algebraic structures thanZ;{\displaystyle \mathbb {Z} ;} for example,polynomials whosegreatest common divisor is 1 are calledcoprime polynomials.

Coprimality in ring ideals

[edit]

TwoidealsA andB in acommutative ringR are called coprime (orcomaximal) ifA+B=R.{\displaystyle A+B=R.} This generalizesBézout's identity: with this definition, twoprincipal ideals (a) and (b) in the ring of integersZ{\displaystyle \mathbb {Z} } are coprime if and only ifa andb are coprime. If the idealsA andB ofR are coprime, thenAB=AB;{\displaystyle AB=A\cap B;} furthermore, ifC is a third ideal such thatA containsBC, thenA containsC. TheChinese remainder theorem can be generalized to any commutative ring, using coprime ideals.

See also

[edit]
Look upcoprime in Wiktionary, the free dictionary.

Notes

[edit]
  1. ^Eaton, James S. (1872).A Treatise on Arithmetic. Boston: Thompson, Bigelow & Brown. p. 49. Retrieved10 January 2022.Two numbers aremutually prime when no whole number butone will divide each of them
  2. ^Hardy & Wright 2008, p. 6
  3. ^Graham, R. L.; Knuth, D. E.; Patashnik, O. (1989),Concrete Mathematics / A Foundation for Computer Science, Addison-Wesley, p. 115,ISBN 0-201-14236-8
  4. ^Ore 1988, p. 47
  5. ^Niven & Zuckerman 1966, p. 22, Theorem 2.3(b)
  6. ^Niven & Zuckerman 1966, p. 6, Theorem 1.8
  7. ^Niven & Zuckerman 1966, p.7, Theorem 1.10
  8. ^Rosen 1992, p. 140
  9. ^This theorem was proved byErnesto Cesàro in 1881. For a proof, seeHardy & Wright 2008, Theorem 332
  10. ^Nymann, J.E. (1972), "On the probability that k positive integers are relatively prime",Journal of Number Theory,4 (5):469–473,doi:10.1016/0022-314X(72)90038-8.
  11. ^Saunders, Robert & Randall, Trevor (July 1994), "The family tree of the Pythagorean triplets revisited",Mathematical Gazette,78:190–193,doi:10.2307/3618576.
  12. ^Mitchell, Douglas W. (July 2001), "An alternative characterisation of all primitive Pythagorean triples",Mathematical Gazette,85:273–275,doi:10.2307/3622017.
  13. ^Klaus Pommerening."Cryptology: Key Generators with Long Periods".
  14. ^David Mowry."German Cipher Machines of World War II".2014.p. 16; p. 22.
  15. ^Dirk Rijmenants."Origins of One-time pad".
  16. ^Gustavus J. Simmons."Vernam-Vigenère cipher".

References

[edit]

Further reading

[edit]
  • Lord, Nick (March 2008), "A uniform construction of some infinite coprime sequences",Mathematical Gazette,92:66–70.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Coprime_integers&oldid=1331118261"
Category:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp