63. The GCD
63.1 Definition: greatest common divisor
The greatest common divisor or GCD of two nonnegative integers $m$ and $n$ is 0 if $m = n = 0$; otherwise the GCD is the largest number which divides both of them.
63.2 Definition: least common multiple
The least common multiple (LCM) of two nonnegative integers $m$ and $n$ is 0 if either $m$ or $n$ is 0; otherwise it is the smallest positive integer which both $m$ and $n$ divide.
63.2.1 Example It follows from the definition that $\operatorname{GCD}(0,0) = 0$, $\operatorname{GCD}(0,4) = \operatorname{GCD}(4,0) = 4$, $\operatorname{GCD}(16,24) = 8$, and $\operatorname{GCD}(5,6) = 1$. Similarly, $\operatorname{LCM}(0,0) = 0$, $\operatorname{LCM}(1,1) = 1$, $\operatorname{LCM}(8,12) = 24$ and $\operatorname{LCM}(5,6) = 30$.
63.2.2 Exercise Find $\operatorname{GCD}(12,12)$, $\operatorname{GCD}(12,13)$, $\operatorname{GCD}(12,14)$, $\operatorname{GCD}(12,24)$, and also find the LCM’s of the same pairs of numbers. (Answer on page 246.)
63.2.3 Exercise Compute $\operatorname{GCD}(48,72)$ and $\operatorname{LCM}(48,72)$.
63.2.4 Exercise If $m$ and $n$ are positive integers and $d = \operatorname{GCD}(m,n)$, must $\operatorname{GCD}(m/d,n) = 1$? Explain your answer. (Answer on page 246.)
63.2.5 Exercise Let $A =\{ 1, 2, 3, 4\}$. Write out all the ordered pairs in the relation $\alpha$ on $A$ where $\alpha$ is defined by: $a\alpha b\Leftrightarrow \operatorname{GCD}(a,b) = 1$. (Answer on page 246.)
63.2.6 Exercise Let $\alpha$ be the relation on $\mathrm{Z}$ defined by $a\alpha b \Leftrightarrow \operatorname{GCD}(a,b) = 1$. Determine which of these properties $\alpha$ satisfies: Reflexive, symmetric, transitive, antisymmetric.
63.2.7 Usage Some texts call the GCD the Greatest Common Factor (GCF).
63.2.8 Remark In general, $\operatorname{GCD}(0,m) = \operatorname{GCD}(m,0) = m$ for any nonnegative integer $m$. Note that Definition 63.1 defined $\operatorname{GCD}(0,0)$ as a special case. This is necessary because every integer divides 0, so there is no largest integer that divides 0. This awkward detail occurs because our definition is in a certain sense not the best definition. (See Corollary 64.2 below.)
63.3 Definition: relatively prime
If $\operatorname{GCD}(m,n) = 1$, then $m$ and $n$ are relatively prime.
63.3.1 Example 5 and 6 are relatively prime, but 74 and 111 are not relatively prime since their GCD is 37.
63.3.2 Exercise Show that for any integer $n$, $n$ and $n+1$ are relatively prime. (Answer on page 246.)
63.3.3 Exercise
a) Show that if $n+1$ distinct integers are chosen from the set $\{ 1, 2,\ldots , 2n\}$, then two of them are relatively prime.
b) Show that there is a way to choose $n$ integers from $\{ 1, 2,\ldots , 2n\}$ so that no two different ones are relatively prime.
63.3.4 Warning The property “relatively prime” concerns two integers. It makes no sense to speak of a single integer as being “relatively prime”.
63.4 Definition: lowest terms
A rational number $m/n$ is in lowest terms (see Definition 7.3, page 11) if $m$ and $n$ are relatively prime.
63.4.1 Exercise Prove that if $m/n$ and $r/s$ are rational numbers represented in lowest terms and $m/n = r/s$, then $|m| = |r|$ and $|n| = |s|$.
Pages 88–89 of the book (PDF).