GCD & LCM
GCD/LCM computation, Euclidean algorithm, gcd*lcm = product
GCD & LCMAMC 10 Step by Step
Name: Date: October 28, 2026
Number Theory · 10 problems have this as their main idea
10
primary-topic problems (0.8% of all)
18
more as a secondary topic
Where it appears
3
P1-10
0
P11-15
2
P16-20
5
P21-25
What you need to know
- gcd times lcm. The gcd (greatest common divisor) is the biggest number dividing both and ; the lcm (least common multiple) is the smallest positive number both divide. For positive integers, .
- With prime factorizations, the gcd takes the smaller exponent of each prime and the lcm takes the larger. Example: and have gcd and lcm , and .
- Euclidean Algorithm. , where is the remainder when is divided by . Repeat until the remainder is . Example: .
- Subtracting multiples. More generally, for any integer , because a number that divides and also divides , and the other way round. Example: .
- Pulling out the gcd. If , write and . Then and share no factor except , and . Example: and , so the lcm is .
- Relatively prime (or coprime) means the gcd is . Consecutive integers are always relatively prime, since a common divisor would also divide their difference, .
- Things that repeat. is the smallest positive number that all of divide. So things that repeat every , …, days all line up again every lcm days. Example: buses every , , and minutes leave together every minutes.
- Counting numbers relatively prime to . For the numbers from to , use the Principle of Inclusion-Exclusion (PIE) on the primes of . Example: from to : .
How AMC 10 tests it
- Word problems in disguise: events with periods of , , , days line up every lcm days; tiles or fence posts use the gcd.
- "Given and , how many pairs ?" or "what is ?" (usually problems 12–18).
- The gcd of huge numbers or expressions, such as or , meant to be simplified with the Euclidean Algorithm.
- Fractions in lowest terms: reduces to denominator ; count the numerators that give a certain reduced denominator.
Standard approaches
- Factor both numbers and take the smaller or larger exponent of each prime. This settles any gcd or lcm of actual numbers.
- For expressions or huge numbers, subtract multiples. Example: , so : if is odd, if is even. Likewise , and continuing gives .
- Write and with ; the problem becomes counting relatively prime pairs.
- Use whenever three of the four are known. Example: if and , then .
- For ordered pairs of relatively prime numbers with product , each prime power of goes entirely to one side. If has different prime factors, that gives pairs. Example: gives pairs: , , , .
Worked example
How many ordered pairs of positive integers satisfy and ?
(A) (B) (C) (D) (E)
Step 1: pull out the gcd. Write and . Then and share no factor except ; otherwise the gcd would be bigger than .
Step 2: use the lcm. , so .
Step 3: split the primes. Since and share no factor, each of , , and goes entirely to or entirely to . (If each got one , both would be even.) That is choices: , , , , and these four reversed.
Step 4: check one. gives , with gcd and lcm .
The answer is .
Pitfalls
- Using "gcd lcm product" for three or more numbers; it holds only for two. Example: for , , , gcd lcm , but the product is .
- Forgetting that and must share no factor after you pull out , which overcounts. Example: above, gives , whose gcd is , not .
- Mixing up ordered and unordered pairs; and count separately unless the problem says otherwise.
- Subtracting the wrong way in the Euclidean Algorithm, such as replacing with when is bigger, and losing track of minus signs. Subtract the smaller from the larger.
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
Open any of them to try it here; the worked solution is on the problem's own page.