Greatest common divisor
In mathematics, the greatest common divisor (GCD), also known as greatest common factor (GCF), of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For two integers , , the greatest common divisor of and is denoted \gcd (x,y) . For example, the GCD of 8 and 12 is 4, that is, . In the name "greatest common divisor", the adjective "greatest" may be replaced by "highest", and the word "divisor" may be replaced by "factor", so that other names include highest common factor (HCF), etc. Historically, other names for the same concept have included greatest common measure. This notion can be extended to polynomials (see Polynomial... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
In mathematics, the greatest common divisor (GCD), also known as greatest common factor (GCF), of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For two integers , , the greatest common divisor of and is denoted \gcd (x,y) . For example, the GCD of 8 and 12 is 4, that is, . In the name "greatest common divisor", the adjective "greatest" may be replaced by "highest", and the word "divisor" may be replaced by "factor", so that other names include highest common factor (HCF), etc. Historically, other names for the same concept have included greatest common measure. This notion can be extended to polynomials (see Polynomial greatest common divisor) and other commutative rings (see below). 54 \times 1 = 27 \times 2 = 18 \times 3 = 9 \times 6. Thus the complete list of divisors of 54 is 1, 2, 3, 6, 9, 18, 27, 54. Similarly, the divisors of 24 are 1, 2, 3, 4, 6, 8, 12, 24. The numbers that these two lists have in common are the common divisors of 54 and 24, that is, 1, 2, 3, 6. Of these, the greatest is 6, so it is the greatest common divisor: \gcd(54,24) = 6. Computing all divisors of the two numbers in this way is usually not efficient, especially for large numbers that have many divisors. Much more efficient methods are described in . \frac{42}{56}=\frac{3 \cdot 14 }{ 4 \cdot 14}=\frac{3 }{ 4}. \operatorname{lcm}(a,b)=\frac {\operatorname{gcd}(a,b)}. Greatest common divisors can be computed by determining the prime factorizations of the two numbers and comparing factors. For example, to compute , we find the prime factorizations 48 = 2 4 · 3 1 and 180 = 2 2 · 3 2 · 5 1 ; the GCD is then 2 min(4,2) · 3 min(1,2) · 5 min(0,1) = 2 2 · 3 1 · 5 0 = 12 The corresponding LCM is then 2 max(4,2) · 3 max(1,2) · 5 max(0,1) = 2 4 · 3 2 · 5 1 = 720. In practice, this method is only feasible for small numbers, as computing prime factorizations takes too long. \begin{align}\gcd(48,18)\quad&\to\quad \gcd(48-18, 18)= \gcd(30,18)\\ &\to \quad \gcd(30-18, 18)= \gcd(12,18)\\ &\to \quad \gcd(12,18-12)= \gcd(12,6)\\ &\to \quad \gcd(12-6,6)= \gcd(6,6).\end{align} So . This method can be very slow if one number is much larger than the other. So, the variant that follows is generally preferred. \begin{align}\gcd(48,18)\quad&\to\quad \gcd(18, 48\bmod 18)= \gcd(18, 12)\\ &\to \quad \gcd(12, 18\bmod 12)= \gcd(12,6)\\ &\to \quad \gcd(6,12\bmod 6)= \gcd(6,0).\end{align} This again gives . Example: (a, b, d) = (48, 18, 0) → (24, 9, 1) → (12, 9, 1) → (6, 9, 1) → (3, 9, 1) → (3, 3, 1) ; the original GCD is thus the product 6 of and . The binary GCD algorithm is particularly easy to implement and particularly efficient on binary computers. Its computational complexity is O((\log a + \log b)^2). The square in this complexity comes from the fact that division by and subtraction take a time that is proportional to the number of bits of the input. The computational complexity is usually given in terms of the length of the input. Here, this length is , and the complexity is thus O(n^2) . \gcd(a,b)=\frac {\operatorname{lcm}(a,b)} , but more commonly the LCM is computed from the GCD. Using Thomae's function , \gcd(a,b) = a f\left(\frac b a\right), which generalizes to and rational numbers or commensurable real numbers. Keith Slavin has shown that for odd : \gcd(a,b)=\log_2\prod_{k=0}^{a-1} (1+e^{-2i\pi k b/a}) which is a function that can be evaluated for complex b. Wolfgang Schramm has shown that \gcd(a,b)=\sum\limits_{k=1}^a \exp (2\pi ikb/a) \cdot \sum\limits_{d\left| a\right.} \frac{c_d (k)}{d} is an entire function in the variable b for all positive integers a where c d (k) is Ramanujan's sum. \gcd(a,b) = \sum_{k|a \text{ and }k|b} \varphi(k) . GCD Summatory function (Pillai's arithmetical function): \sum_{k=1}^n \gcd(k,n) = \sum_{d|n} d \varphi \left( \frac n d \right) =n\sum_{d|n}\frac{\varphi(d)}{d} =n\prod_{p|n}\left(1+\nu_p(n)\left(1-\frac{1}{p}\right)\right) where \nu_p(n) is the -adic valuation. \mathrm{E}( \mathrm{2} ) = \sum_{d=1}^\infty d (d^{-2}/\zeta(2)) = \frac{1}{\zeta(2)} \sum_{d=1}^\infty \frac{1}{d}. This last summation is the harmonic series, which diverges. However, when , the expected value is well-defined, and by the above argument, it is \mathrm{E}(k) = \sum_{d=1}^\infty d^{1-k} \zeta(k)^{-1} = \frac{\zeta(k-1)}{\zeta(k)}. For , this is approximately equal to 1.3684. For , it is approximately 1.1106. If is a commutative ring, and and are in , then an element of is called a common divisor of and if it divides both and (that is, if there are elements and in such that d·x = a and d·y = b). If is a common divisor of and , and every common divisor of and divides , then is called a greatest common divisor of and b. With this definition, two elements and may very well have several greatest common divisors, or none at all. If is an integral domain, then any two GCDs of and must be associate elements, since by definition either one must divide the other. Indeed, if a GCD exists, any one of its associates is a GCD as well. Existence of a GCD is not assured in arbitrary integral domains. However, if is a unique factorization domain or any other GCD domain, then any two elements have a GCD. If is a Euclidean domain in which euclidean division is given algorithmically (as is the case for instance when where is a field, or when is the ring of Gaussian integers), then greatest common divisors can be computed using a form of the Euclidean algorithm based on the division procedure. The following is an example of an integral domain with two elements that do not have a GCD: R = \mathbb{Z}\left[\sqrt{-3}\,\,\right],\quad a = 4 = 2\cdot 2 = \left(1+\sqrt{-3}\,\,\right)\left(1-\sqrt{-3}\,\,\right),\quad b = \left(1+\sqrt{-3}\,\,\right)\cdot 2. The elements and 1 + \sqrt{-3} are two maximal common divisors (that is, any common divisor which is a multiple of is associated to , the same holds for 1 + \sqrt{-3} , but they are not associated, so there is no greatest common divisor of and . Corresponding to the Bézout property we may, in any commutative ring, consider the collection of elements of the form , where and range over the ring. This is the ideal generated by and , and is denoted simply . In a ring all of whose ideals are principal (a principal ideal domain or PID), this ideal will be identical with the set of multiples of some ring element ; then this is a greatest common divisor of and . But the ideal can be useful even when there is no greatest common divisor of and . (Indeed, Ernst Kummer used this ideal as a replacement for a GCD in his treatment of Fermat's Last Theorem, although he envisioned it as the set of multiples of some hypothetical, or ideal, ring element , whence the ring-theoretic term.) gcd(x,y) = y function graph: https://www.desmos.com/calculator/6nizzenog5
Cite this
"Greatest common divisor". 1788110266. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1372179102 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy