Topics / Number Theory
GCD & LCM
GCD/LCM computation, Euclidean algorithm, gcd*lcm = product
What you need to know
- For positive integers : . This extends to prime exponents: takes the minimum exponent of each prime, the maximum.
- Euclidean algorithm: ; more generally for any integer .
- If , then , with , and .
- is called relatively prime (coprime). Consecutive integers are always coprime.
- is the smallest positive integer divisible by all ; it is the period of anything that repeats with periods .
- The count of coprime to a fixed can be found by inclusion–exclusion over the primes of .
How AMC 10 tests it
- Word problems in disguise: events with periods days coincide every days; tiles or fence posts use .
- "Given and , how many pairs ?" or "what is ?" (usually problems 12–18).
- of two large or symbolic numbers, such as or , meant to be simplified by the Euclidean algorithm.
- Fractions in lowest terms: reduced has denominator ; count numerators with a given reduced denominator.
Standard approaches
- Factor both numbers and take min/max exponents; this settles any concrete / instantly.
- For symbolic or huge inputs, subtract multiples: .
- Substitute , with ; the problem becomes a coprime-pair count.
- Use whenever three of the four quantities are known.
- For coprime ordered pairs with product , each prime power of goes entirely to one side: pairs, where is the number of distinct primes.
Worked example
How many ordered pairs of positive integers satisfy and ?
(A) (B) (C) (D) (E)
Write and with . Then , so . Because and are coprime, each prime power , , must go entirely to or entirely to : that is choices, giving the ordered pairs and their reverses. Each yields a valid , for example . The answer is .
Pitfalls
- Using product for three or more numbers; the identity holds only for two.
- Forgetting the coprimality condition after factoring out , which overcounts pairs.
- Confusing ordered and unordered pairs; and count separately unless stated otherwise.
- Reducing by subtracting the wrong direction, e.g., replacing with when and losing track of signs.
Traps that recur
- Accepting statement I by analogy with II without testing it; a = 1, b = 3 gives c = 57, which is divisible by 3. (2023 AMC 10B #18)
- Stopping at the first n > 1000 satisfying the divisibility parts (n = 1077, digit sum 15) without checking that the gcds are exactly 21 and 60. (2020 AMC 10A #24)
- Assuming gcd(d,a) is just some multiple of 6 and picking 72, 84, 90 or 96, which would force extra factors of 2 or 3 that contradict the given gcds. (2018 AMC 10A #22)
- Forgetting that x and y must be coprime, so that xy = 9 wrongly admits (3,3) (which has gcd 63, not 21) and yields 3 ordered pairs instead of 2. (2018 AMC 10B #23)
Problems, easiest first
The least common multiple of a positive integer and is , and the greatest common divisor of and is . What is the sum of the digits of ?
Each piece of candy in a store costs a whole number of cents. Casper has exactly enough money to buy either pieces of red candy, pieces of green candy, pieces of blue candy, or pieces of purple candy. A piece of purple candy costs cents. What is the smallest possible value of ?
Wanda, Darren, Beatrice, and Chi are tutors in the school math lab. Their schedule is as follows: Darren works every third school day, Wanda works every fourth school day, Beatrice works every sixth school day, and Chi works every seventh school day. Today they are all working in the math lab. In how many school days …
Let be the unique positive integer such that dividing by leaves a remainder of and dividing by leaves a remainder of . What is the tens digit of ?
Suppose , , and are positive integers such that Which of the following statements are necessarily true? I. If or or both, then . II. If , then or or both. III. …
Let be the least positive integer greater than for which What is the sum of the digits of ?
How many ordered pairs of positive integers satisfy the equation where denotes the greatest common divisor of and , and denotes their least common multiple?
Let and be positive integers such that , , , and . Which of the following must be a divisor of ?
How many ordered triples of positive integers satisfy and ?
Let be the set of the smallest positive multiples of , and let be the set of the smallest positive multiples of . How many elements are common to and ?