# Definition:Greatest Common Divisor/Integers/General Definition

## Definition

Let $S = \set {a_1, a_2, \ldots, a_n} \subseteq \Z$ such that $\exists x \in S: x \ne 0$ (that is, at least one element of $S$ is non-zero).

### Definition 1

The **greatest common divisor** of $S$:

- $\gcd \paren S = \gcd \set {a_1, a_2, \ldots, a_n}$

is defined as the largest $d \in \Z_{>0}$ such that:

- $\forall x \in S: d \divides x$

where $\divides$ denotes divisibility.

### Definition 2

The **greatest common divisor** of $S$:

- $\gcd \paren S = \gcd \set {a_1, a_2, \ldots, a_n}$

is defined as the (strictly) positive integer $d \in \Z_{>0}$ such that:

\(\ds \forall x \in S:\) | \(\ds d \divides x \) | ||||||||

\(\ds \forall e \in \Z: \forall x \in S:\) | \(\ds e \divides x \implies e \divides d \) |

where $\divides$ denotes divisibility.

By convention:

- $\map \gcd \O = 1$

## Also known as

The **greatest common divisor** is often seen abbreviated as **GCD**, **gcd** or **g.c.d.**

Some sources write $\gcd \set {a, b}$ as $\tuple {a, b}$, but this notation can cause confusion with ordered pairs.

The notation $\map \gcd {a, b}$ is frequently seen, but the set notation, although a little more cumbersome, can be argued to be preferable.

The **greatest common divisor** is also known as the **highest common factor**, or **greatest common factor**.

**Highest common factor** when it occurs, is usually abbreviated as **HCF**, **hcf** or **h.c.f.**

It is written $\hcf \set {a, b}$ or $\map \hcf {a, b}$.

The archaic term **greatest common measure** can also be found, mainly in such as Euclid's *The Elements*.

## Examples

### Example: $39$, $42$, $54$

Let $S = \set {39, 42, 54}$.

The greatest common divisor of $S$ is:

- $\map \gcd S = 3$

### Example: $49$, $210$, $350$

Let $S = \set {49, 210, 350}$.

The greatest common divisor of $S$ is:

- $\map \gcd S = 7$

## Also see

- Greatest Common Divisor is Associative for a justification of this construction.