2001 AMC 10 Problem 25
How many positive integers not exceeding are multiples of or but not ?
Show solution without answering
Key insight
Count multiples of 3 or 4 first. Then remove only those that are also multiples of 5, which are the multiples of 15 or 20.
Solution
Step 1: multiples of or .
- Multiples of up to : , so there are .
- Multiples of : , so there are .
- Numbers that are multiples of both and are the multiples of , and they were counted twice. , so there are .
- Subtract the double count: numbers are multiples of or .
Step 2: remove the ones that are also multiples of .
- A number that is a multiple of and of is a multiple of . A multiple of and of is a multiple of . So we must remove the multiples of or .
- Multiples of : , so . Multiples of : , so .
- Numbers that are multiples of both and are the multiples of , counted twice. , so .
- So of the numbers are multiples of .
Step 3: answer.
- .
The answer is .
Why this works
When counting "this or that," add the two counts and subtract the numbers counted twice. "But not " means removing only the numbers already in the list that are also multiples of , and that is another "this or that" count (multiples of or ). Keep the steps separate so no overlap is forgotten.
Alternative approach
The pattern of multiples of , and repeats every numbers. From to , there are multiples of and of , with counted twice, so are multiples of or . Of these, are multiples of , leaving . Since , the numbers to contain . The remaining numbers to that work are , which is more. Total: .
Concise solution
A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.
First count the numbers up to that are multiples of or . Multiples of : . Multiples of : . Both (multiples of ): . By inclusion-exclusion,
Now throw out those that are also multiples of . A number divisible by and by or is a multiple of or of . Multiples of : ; multiples of : ; multiples of both, i.e. of : . So
of the numbers are divisible by .
The count we want is .
The answer is .
Review in the AoPS books
- Introduction to Counting & Probability, Chapter 1: Counting Is Arithmetic (§1.3)
- Introduction to Number Theory, Chapter 1: Integers: The Basics (§1.4, §1.5)
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques (§2.3)
- Intermediate Counting & Probability, Chapter 3: A Piece of PIE (§3.2, §3.3)
Similar problems
Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site. Also appeared as 2001 12 #12.