0% found this document useful (0 votes)
300 views5 pages

MC35 Number Theory Ch07 Handout-209

The document provides information about greatest common divisors (GCD) and least common multiples (LCM) including: 1) It defines GCD as the largest positive number that divides two numbers and provides the Euclidean algorithm to calculate GCD. 2) It defines LCM as the smallest positive number that is a multiple of two numbers and provides a formula for calculating LCM using GCD. 3) It includes examples of using the Euclidean algorithm to calculate GCDs and solving problems involving GCDs and LCMs.

Uploaded by

SCARLETT CARSON
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
300 views5 pages

MC35 Number Theory Ch07 Handout-209

The document provides information about greatest common divisors (GCD) and least common multiples (LCM) including: 1) It defines GCD as the largest positive number that divides two numbers and provides the Euclidean algorithm to calculate GCD. 2) It defines LCM as the smallest positive number that is a multiple of two numbers and provides a formula for calculating LCM using GCD. 3) It includes examples of using the Euclidean algorithm to calculate GCDs and solving problems involving GCDs and LCMs.

Uploaded by

SCARLETT CARSON
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Chapter 7

GCD & LCM

7.1 Notes
The greatest common divisor of two (non-negative) numbers, denoted gcd(a, b),
is simply what the name implies: the largest positive number that is a divisor of both of
them. You probably already know one way to compute the gcd of two numbers: factor both
of them, and for each prime, take the smallest exponent. For example, gcd(252, 1200) =
22 × 31 = 12: 252 = 22 · 32 · 7 and 1200 = 24 · 3 · 52 , so the smallest exponent of 2 is 22 and
the smallest exponent of 3 is 31 .
We give some simple facts about the gcd:
Theorem 7.1.1. For positive integer a, we have gcd(a, a) = a and gcd(a, 0) = a.
Theorem 7.1.2. For positive integers a, b, c, we have gcd(ac, bc) = c gcd(a, b).
Two numbers are relatively prime if their greatest common divisor is 1. This does
not imply that the numbers are prime. For example, 12 and 35 are relatively prime. n
numbers are pairwise relatively prime if the greatest common divisor between any pair
of them is 1.

Euclidean Algorithm
If the numbers are difficult to factor, there is another way we can compute the gcd of
two numbers. This is called the Euclidean algorithm. The algorithm makes use of the
following lemma:
Lemma 7.1.3. For positive integers a and b such that a ≥ b, we have gcd(a, b) = gcd(a −
b, b).
Proof. We will let d denote the greatest common divisor of a and b. Since d divides a and
b (by definition), d must divide their difference, so d | a − b.

28
MC35N Chapter 7. GCD & LCM

However, we must show that d is actually the greatest common divisor of a − b and b
(we have only shown so far that d is a common divisor of a − b and b). If we assume that
gcd(a − b, b) = d0 for some d0 > d, then d0 divides both a − b and b, implying that d0 divides
their sum, which is (a − b) + b = a. But this implies d0 divides a and b, a contradiction.

The Euclidean algorithm to compute gcd(a, b) can be stated as follows:

ˆ Start with the pair (a, b). We can assume a ≥ b. If b > a, then swap a and b.

ˆ Replace (a, b) with (a − b, b).

ˆ Repeat until one of a or b is zero. The non-zero number is equal to gcd(a, b).

To speed things up, we can replace (a, b) with (r, b), where r is the remainder when a
is divided by b.

Example 7.1.4. Find gcd(646, 874).

Solution. Using the Euclidean algorithm:

(646, 874) → (874, 646)


→ (228, 646)
→ (646, 228) → (190, 228)
→ (228, 190) → (38, 190)
→ (190, 38) → (0, 38)

Then gcd(a, b) = 38 . As a check, 646 = 2 × 17 × 19 and 874 = 2 × 19 × 23.

A classic example comes from the very first International Mathematical Olympiad
(IMO):
21n+4
Example 7.1.5 (1959 IMO #1). Prove that the fraction 14n+3 is irreducible for every
natural number n.

Proof. It suffices to show that the numerator and denominator are relatively prime, or that
gcd(21n + 4, 14n + 3) = 1. We can also use the Euclidean algorithm:

(21n + 4, 14n + 3) → (7n + 1, 14n + 3)


→ (14n + 3, 7n + 1) → (7n + 2, 7n + 1) → (1, 7n + 1)
→ (7n + 1, 1) → (0, 1)

Therefore gcd(21n + 4, 14n + 3) = 1, so the fraction is irreducible for every natural n.

29
MC35N Chapter 7. GCD & LCM

Example 7.1.6 (2007 AMC 12B #24). How many pairs of positive integers (a, b) are
there such that gcd(a, b) = 1 and
a 14b
+
b 9a
is an integer?
9a2 + 14b2
Proof. We combine the fractions to get that is an integer, so 9ab | 9a2 + 14b2 .
9ab
We need that 9 | 14b2 for this to be true, so b = 3c for some integer c. Plugging back in,
we find that 27ac | 9a2 + 14 · 9c2 =⇒ 3ac | a2 + 14c2 . Now we need that c | a2 , but
gcd(a, c) = 1, so c must be 1. Then we need that 3a | a2 + 14.
Notice we must have 3 | a2 + 14, which is impossible if a is a multiple of 3. But notice
that if a is not a multiple of 3, then 3 | a2 + 14 (try a few values if you are not convinced!).
Therefore, we need a | a2 +14, so a | 14, which only happens for a = 1, 2, 7 and 14. Plugging
these back in and checking the values of b, all of them work, so there are 4 solutions.

Least Common Multiple


The least common multiple (LCM) of two positive integers a and b, denoted lcm(a, b),
is the smallest positive number that a multiple of both a and b. We can compute the least
common multiple by instead taking the largest exponent of each prime. For example,
lcm(252, 1200) = 24 × 32 × 52 × 7 = 25200.

Theorem 7.1.7. For positive numbers a and b, we have


ab
lcm(a, b) =
gcd(a, b)

Proof. To prove this, we can equivalently show that lcm(a, b) gcd(a, b) = ab. The main
idea is that if p is any prime, and if νp (a) and νp (b) represent the largest power of p that
divides a and b respectively, then the GCD of a and b will contain pmin(νp (a),νp (b)) in its
prime factorization - that is, νp (gcd(a, b)) = min(νp (a), νp (b)).
Similarly, the LCM of a and b will contain pmax(νp (a),νp (b)) in its prime factorization.
Then gcd(a, b)lcm(a, b) will contain pmin(νp (a),νp (b))+max(νp (a),νp (b)) in its prime factorization.
Using the fact that min(x, y) + max(x, y) = x + y, then the largest power of p that
divides gcd(a, b)lcm(a, b) is pνp (a)+νp (b) . Doing this for all primes p, we can show that the
product of the GCD and LCM of a and b equals ab.

Example 7.1.8 (2018 AMC 10B #23). How many ordered pairs (a, b) of positive integers
satisfy the equation
a · b + 63 = 20 · lcm(a, b) + 12 · gcd(a, b),
where gcd(a, b) denotes the greatest common divisor of a and b, and lcm(a, b) denotes their
least common multiple?

30
MC35N Chapter 7. GCD & LCM

Solution. We can replace a · b with gcd(a, b)lcm(a, b). Letting d = gcd(a, b) and m =
lcm(a, b), we have

dm + 63 = 20m + 12d ⇐⇒ dm − 12d − 20m + 63 = 0

It almost looks like we can apply SFFT here, on the expression (d − 20)(m − 12). To
compensate, we add 240 − 63 = 177 to both sides, then use SFFT:

(d − 20)(m − 12) = 177

The factor pairs of 177 are 1 × 177 and 3 × 59. Since d ≤ m, the only possibilities
are (d, m) = (21, 189) or (23, 71). The first pair gives 2 solutions (a, b) = (21, 189) and
(189, 21). The second pair gives no solutions. Thus the number of pairs is 2 .

7.2 Examples
1. (Lehigh MC-2008-35) Let an denote the n-digit positive integer all of whose digits
are 1. For example, a3 = 111. What is the greatest common divisor of a45 and a140 ?

2. (Lehigh MC-2014-34) Out of all relatively prime integers a and b, what is the largest
possible value of the greatest common divisor of a + 201b and 201a + b?

3. (Richard Spence) Using the Euclidean algorithm, find a two-digit positive integer n
such that 103n leaves remainder 1 when divided by 46 (hint: compute gcd(46, 103)).

4. (HMMT Nov-2015-Guts-20) Let n be a three-digit integer with nonzero digits, not


all of which are the same. Define f (n) to be the greatest common divisor of the six
integers formed by the permutations of the digits of n. For example, f (123) = 3,
because gcd(123, 132, 213, 231, 312, 321) = 3. Let the maximum possible value of f (n)
be k. Find the sum of all n for which f (n) = k.

7.3 Exercises
1. (AMC10-2018-A22) Let a, b, c, and d be positive integers such that gcd(a, b) =
24, gcd(b, c) = 36, gcd(c, d) = 54, and 70 < gcd(d, a) < 100. Which of the follow-
ing must be a divisor of a?

(A) 5 (B) 7 (C) 11 (D) 13 (E) 17

2. (AMC10-2016-A25) How many ordered triples (x, y, z) of positive integers satisfy


lcm(x, y) = 72, lcm(x, z) = 600, and lcm(y, z) = 900?

(A) 15 (B) 16 (C) 24 (D) 27 (E) 64

31
MC35N Chapter 7. GCD & LCM

3. (HMMT Nov-2015-Guts-15) Find the smallest positive integer b such that 1111b (1111
in base b) is a perfect square. If no such b exists, write “No solution.”

4. (AMC10-2011-A25) Let R be a square region and n ≥ 4 an integer. A point X in the


interior of R is called n-ray partitional if there are n rays emanating from X that
divide R into n triangles of equal area. How many points are 100-ray partitional but
not 60-ray partitional?

(A) 1500 (B) 1560 (C) 2320 (D) 2480 (E) 2500

32

You might also like