Skip to content

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.

Version
v2 · 2026-11-14 · History
Domain-specific #
9754
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomain
Number Theory → Mathematics

Core Idea

The greatest common divisor (GCD) of two or more integers, not all zero, is the largest positive integer that divides each of them. It is also called the greatest common factor (GCF) or highest common factor (HCF), and historically the greatest common measure. For two integers \(x\) and \(y\) it is written \(\gcd(x,y)\); for example, \(\gcd(8,12)=4\), since 4 divides both 8 and 12 and no larger integer does.

When one argument is zero, the GCD is the absolute value of the other: \(\gcd(a,0)=\gcd(0,a)=|a|\), the case that serves as the terminating step of the Euclidean algorithm. The definition by size cannot fix \(\gcd(0,0)\), because every integer divides 0; but if "greatest" is read in terms of the divisibility relation, zero is its own greatest divisor, so \(\gcd(0,0)\) is commonly defined as 0. This convention preserves Bézout's identity, that \(\gcd(a,b)\) generates the same ideal as \(\{a,b\}\), though some authors leave \(\gcd(0,0)\) undefined.

Two integers are coprime, or relatively prime, when their GCD is 1, as with 9 and 28. The GCD reduces fractions to lowest terms (\(\gcd(42,56)=14\), so \(42/56=3/4\)) and yields the least common multiple through \(\operatorname{lcm}(a,b)=|a\cdot b|/\gcd(a,b)\) for integers not both zero. The notion extends beyond the integers to polynomials and to other commutative rings.

How would you explain it like I'm…

Biggest Fair-Share Number

Say you have 8 apples and 12 oranges and want to make matching snack bags with no fruit left over. The biggest number of bags you can make is 4. That number, the biggest one that splits both piles evenly, is the Greatest Common Divisor.

Biggest Shared Divider

The Greatest Common Divisor of two numbers is the largest whole number that divides both of them with no remainder. For 8 and 12, the numbers that divide 8 are 1, 2, 4, 8, and the ones that divide 12 are 1, 2, 3, 4, 6, 12. The biggest one they share is 4, so the GCD is 4. It's also called the greatest common factor or highest common factor. You can use it for more than two numbers too.

Largest Common Divisor

The Greatest Common Divisor (GCD) of two or more integers, not all zero, is the largest positive integer that divides each of them exactly. It's written gcd(x, y); for example, gcd(8, 12) = 4. Other names include greatest common factor (GCF) and highest common factor (HCF), and historically 'greatest common measure.' The 'not all zero' condition matters because every integer divides 0, so gcd(0, 0) would have no largest value. The idea also extends beyond integers, for instance to polynomials.

 

For integers a₁, …, aₖ not all zero, the greatest common divisor gcd(a₁, …, aₖ) is the largest positive integer d dividing every aᵢ. The non-zero requirement ensures the set of common divisors is finite and so has a maximum. A standard example is gcd(8, 12) = 4, since the common positive divisors are 1, 2, and 4. Equivalent names include greatest common factor, highest common factor, and the older greatest common measure. The notion generalizes to polynomials and to other commutative rings, where 'greatest' is understood via divisibility rather than size. What identifies the concept is exactly this definition—largest positive common divisor—not merely the name or a familiar example.

Structural Signature

Sig role-phrases:

  • Defining carrier — The least common multiple of two integers that are not both zero can be computed from their greatest common divisor, by using the relation \(\operatorname{lcm}(a,b)=\frac{|a\cdot b|}{\operatorname{gcd}(a,b)}\).
  • Constitutive relation — Greatest common divisors can be computed by determining the prime factorizations of the two numbers and comparing factors.
  • Operating condition — Its efficiency results from the fact that, in binary representation, testing parity consists of testing the right-most digit, and dividing by two consists of removing the right-most digit.
  • Recognition evidence — If \(a\) and \(b\) are both nonzero, the greatest common divisor of \(a\) and \(b\) can be computed by using least common multiple (LCM) of \(a\) and \(b\).
  • Admissible variation — Although the problem is not known to be in NC, parallel algorithms asymptotically faster than the Euclidean algorithm exist; the fastest known deterministic algorithm is by Chor and Goldreich, which (in the CRCW-PRAM model) can solve the problem in \(O(n/\log n)\) time with \(n^{1+\varepsilon}\) processors.
  • Characteristic consequence — This is commonly proved by using either Euclid's lemma, the fundamental theorem of arithmetic, or the Euclidean algorithm.
  • Failure boundary — The method introduced by Euclid for computing greatest common divisors is based on the fact that, given two positive integers \(a\) and \(b\) such that \(a > b\), the common divisors of \(a\) and \(b\) are the same as the common divisors of \(a - b\) and \(b\).

What It Is Not

  • Not the whole field of mathematics, logic, and statistics. The node requires the specific identity stated by 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.
  • Not an over-broad reading. The GCD problem is not known to be in NC, and so there is no known way to parallelize it efficiently; nor is it known to be P-complete, which would imply that it is unlikely to be possible to efficiently parallelize GCD computation.
  • Not an over-broad reading. However, zero is its own greatest divisor if greatest is understood in the context of the divisibility relation, so \(\gcd(0,0)\) is commonly defined as $0$.
  • Not an over-broad reading. The number 54 can be expressed as a product of two integers in several different ways: \(54 \times 1 = 27 \times 2 = 18 \times 3 = 9 \times 6\).
  • Not automatically Coprime integers. Retrieval proximity does not establish equivalence; the two identities must be compared by carrier, operation, and failure boundary.

Scope of Application

Greatest Common Divisor applies literally inside mathematics, logic, and statistics wherever the source-defined carrier and relation can be established. Its documented habitats include:

  • CalculationUsing prime factorizations. In practice, this method is only feasible for small numbers, as computing prime factorizations takes too long.
  • OverviewDefinition. This is the meaning of "greatest" that is used for the generalizations of the concept of GCD.
  • Euclid's algorithm. The method introduced by Euclid for computing greatest common divisors is based on the fact that, given two positive integers \(a\) and \(b\) such that \(a > b\), the common divisors of \(a\) and \(b\) are the same as the common divisors of \(a - b\) and \(b\).
  • Euclid's algorithm. So, Euclid's method for computing the greatest common divisor of two positive integers consists of replacing the larger number with the difference of the numbers, and repeating this until the two numbers are equal: that is their greatest common divisor.
  • Euclid's algorithm. This method can be very slow if one number is much larger than the other.
  • Euclidean algorithm. A more efficient method is the Euclidean algorithm, a variant in which the difference of the two numbers \(a\) and \(b\) is replaced by the remainder of the Euclidean division (also called division with remainder) of \(a\) by \(b\).

Outside mathematics, logic, and statistics, the name should be retained only when these same operational conditions survive; otherwise the comparison belongs to the broader parent Evaluation or should be marked as analogy.

Clarity

A clear use of Greatest Common Divisor names the carrier, the operative relation, and the conditions under which the source treats the identity as present. The minimal definition is 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. The strongest recognition evidence is: If \(a\) and \(b\) are both nonzero, the greatest common divisor of \(a\) and \(b\) can be computed by using least common multiple (LCM) of \(a\) and \(b\). A report should distinguish that evidence from a proxy, consequence, or common implementation. It should also state the qualification The GCD problem is not known to be in NC, and so there is no known way to parallelize it efficiently; nor is it known to be P-complete, which would imply that it is unlikely to be possible to efficiently parallelize GCD computation. so that a reader can reproduce the classification rather than infer it from topical resemblance.

Manages Complexity

Greatest Common Divisor compresses multiple mathematics, logic, and statistics details into a stable diagnostic relation. The source shows both the central mechanism—greatest common divisors can be computed by determining the prime factorizations of the two numbers and comparing factors.—and the practical consequence—this is commonly proved by using either Euclid's lemma, the fundamental theorem of arithmetic, or the Euclidean algorithm. This compression makes cases comparable while leaving parameters, conventions, exceptions, and evidential quality explicit. It is lossy by design: local history and implementation details may be omitted only when they do not alter the defining relation.

Abstract Reasoning

  1. Type the carrier. Identify the mathematics, logic, and statistics entities to which the claim applies.
  2. State the relation. Use the source-grounded identity: 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.
  3. Check operation and conditions. Its efficiency results from the fact that, in binary representation, testing parity consists of testing the right-most digit, and dividing by two consists of removing the right-most digit.
  4. Demand recognition evidence. If \(a\) and \(b\) are both nonzero, the greatest common divisor of \(a\) and \(b\) can be computed by using least common multiple (LCM) of \(a\) and \(b\).
  5. Test variation. Change an implementation or setting while preserving although the problem is not known to be in NC, parallel algorithms asymptotically faster than the Euclidean algorithm exist; the fastest known deterministic algorithm is by Chor and Goldreich, which (in the CRCW-PRAM model) can solve the problem in \(O(n/\log n)\) time with \(n^{1+\varepsilon}\) processors.
  6. Run the collapse test. Remove the defining operation; if the label still seems equally apt, only a topic or correlate was retained.
  7. Reduce cautiously. When the specialist conditions cannot be carried, route the residual comparison to Evaluation.

Knowledge Transfer

Within the home domain. Knowledge about Greatest Common Divisor transfers literally when a new case preserves the same carrier type, relation, and recognition test. In practice, this method is only feasible for small numbers, as computing prime factorizations takes too long. This is the meaning of "greatest" that is used for the generalizations of the concept of GCD.

Beyond the home domain. No canonical parent is asserted for Greatest Common Divisor. An outside case receives the specialist name only when the same typed roles and rejection conditions can be filled literally; otherwise the comparison remains an analogy pending later graph densification.

Examples

Canonical

This case is important as the terminating step of the Euclidean algorithm. This case is canonical because it supplies a concrete carrier and lets the defining relation be checked rather than merely named.

Mapped back: carrier → the entities in the documented case; operation → 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; recognition evidence → If \(a\) and \(b\) are both nonzero, the greatest common divisor of \(a\) and \(b\) can be computed by using least common multiple (LCM) of \(a\) and \(b\)

Applied / In Practice

For example, a 24-by-60 rectangular area can be divided into a grid of: 1-by-1 squares, 2-by-2 squares, 3-by-3 squares, 4-by-4 squares, 6-by-6 squares or 12-by-12 squares. The applied case shows how the identity is used under a second setting or qualification while keeping the same operative relation.

Mapped back: changed setting → A geometric view; invariant → 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; boundary → the case exits the class when the GCD problem is not known to be in NC, and so there is no known way to parallelize it efficiently; nor is it known to be P-complete, which would imply that it is unlikely to be possible to efficiently parallelize GCD computation

Structural Tensions

T1 — Stable identity versus admissible variation. The GCD problem is not known to be in NC, and so there is no known way to parallelize it efficiently; nor is it known to be P-complete, which would imply that it is unlikely to be possible to efficiently parallelize GCD computation. The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: Which changes preserve the defining relation, and which replace it?

T2 — Recognition versus proxy. However, zero is its own greatest divisor if greatest is understood in the context of the divisibility relation, so \(\gcd(0,0)\) is commonly defined as $0$. The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: Does the cited evidence establish the identity or only a correlated sign?

T3 — Definition versus implementation. The number 54 can be expressed as a product of two integers in several different ways: \(54 \times 1 = 27 \times 2 = 18 \times 3 = 9 \times 6\). The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: Is the observed implementation constitutive, optional, or merely common?

T4 — Scope versus overextension. Computing all divisors of the two numbers in this way is usually not efficient, especially for large numbers that have many divisors. The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: Can every claimed application fill the same typed roles without metaphor?

T5 — Transfer versus domain accent. The least common multiple of two integers that are not both zero can be computed from their greatest common divisor, by using the relation \(\operatorname{lcm}(a,b)=\frac{|a\cdot b|}{\operatorname{gcd}(a,b)}\). The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: Does the receiving case instantiate Greatest Common Divisor literally, co-instantiate Evaluation, or only resemble it?

T6 — Autonomy versus reduction. Greatest common divisors can be computed by determining the prime factorizations of the two numbers and comparing factors. The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: What does Greatest Common Divisor distinguish that the broader parent Evaluation leaves together?

Structural–Framed Character

Greatest Common Divisor is structural-leaning. Its structural side is the repeatable organization summarized by 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. Its framed side is the mathematics, logic, and statistics vocabulary that fixes the carrier, evidence, exceptions, and admissible transformations.

Evaluative weight: the identity can be stated descriptively even when applications carry practical stakes. Human-practice dependence: the source-grounded carrier determines whether the relation exists independently or is constituted by a practice. Institutional origin: disciplinary conventions stabilize the name and test. Vocabulary portability: Its efficiency results from the fact that, in binary representation, testing parity consists of testing the right-most digit, and dividing by two consists of removing the right-most digit. Import versus recognition: literal transfer requires the same mechanism; shape alone is analogy.

Its portable skeleton is Evaluation. Its character: a recurring specialist identity whose thin organization can be abstracted, while its operational meaning remains domain-bound.

Structural Core vs. Domain Accent

What is skeletal. 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. The stable skeleton is the typed relation expressed in that definition and the entry's recognition and collapse tests. The source identifies these operative conditions: The least common multiple of two integers that are not both zero can be computed from their greatest common divisor, by using the relation \(\operatorname{lcm}(a,b)=\frac{|a\cdot b|}{\operatorname{gcd}(a,b)}\). Greatest common divisors can be computed by determining the prime factorizations of the two numbers and comparing factors. It further constrains recognition and variation through: Its efficiency results from the fact that, in binary representation, testing parity consists of testing the right-most digit, and dividing by two consists of removing the right-most digit. If \(a\) and \(b\) are both nonzero, the greatest common divisor of \(a\) and \(b\) can be computed by using least common multiple (LCM) of \(a\) and \(b\).

What is domain-bound. mathematics, logic, and statistics supplies the operative entities, technical vocabulary, warrants, and exceptions that make Greatest Common Divisor literal. Its documented scope includes the condition that In practice, this method is only feasible for small numbers, as computing prime factorizations takes too long. Another bounded application condition is that This is the meaning of "greatest" that is used for the generalizations of the concept of GCD. These are not decorative examples; they determine which carrier and evidence can fill the abstraction's roles.

Why no parent is asserted. Removing those specialist details does not currently yield one live catalog node that is a necessary genus for every instance. The entry is therefore approved as unparented rather than attached by topical resemblance. Its collapse evidence remains specific—Although the problem is not known to be in NC, parallel algorithms asymptotically faster than the Euclidean algorithm exist; the fastest known deterministic algorithm is by Chor and Goldreich, which (in the CRCW-PRAM model) can solve the problem in \(O(n/\log n)\) time with \(n^{1+\varepsilon}\) processors.—and future graph densification may discover a defensible relation only if it preserves that boundary.

  • Approved unparented node. No current live node supplies a defensible necessary genus or structural prerequisite for Greatest Common Divisor. The reviewed identity is: 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. The accelerated suggestion was declined because topical or lexical similarity does not establish hierarchy; the node is admitted without a parent pending later graph densification.
  • Related reasoning operations. Evidence, representation, comparison, classification, transformation, or evaluation may participate in particular cases, but participation does not make any one of them a necessary parent of every instance.

Neighborhood in Abstraction Space

Greatest Common Divisor sits in a moderately populated region (48th percentile for distinctiveness): it has near-neighbors but no dense thicket of look-alikes.

Family — Number-Theoretic Properties & Tests (22 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

Not to Be Confused With

  • Evaluation. The parent omits the specialist differentia. Tell: Can the case establish 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?
  • Coprime integers. Two numbers whose only common factor is 1. Tell: Which entry's carrier, operation, and failure condition are satisfied?
  • Pillai's Arithmetical Function. The multiplicative gcd-sum function P(n)=sum from k=1 to n of gcd(k,n), whose divisor-class decomposition P=idphi exposes prime-power evaluation, Euler products, and average-order analysis. *Tell:** Which entry's carrier, operation, and failure condition are satisfied?
  • Composite number. A positive integer greater than one that can be expressed as a product of two smaller positive integers. Tell: Which entry's carrier, operation, and failure condition are satisfied?
  • A measurement, proxy, or consequence. Those may provide evidence without being the identity. Tell: Would Greatest Common Divisor remain present if the detector or downstream effect changed?
  • A metaphorical analogue. A similar shape outside mathematics, logic, and statistics lacks the specialist mechanism. Tell: Do the native roles transfer literally, or only the parent Evaluation?

References

  • Frozen Wikipedia discovery revision: https://en.wikipedia.org/wiki/Greatest_common_divisor (revision 1370836327).