2005 AMC 10B Problem 13
How many numbers between and are integer multiples of or but not ?
Show solution without answering
Key insight
Multiples of 12 appear in both the list of multiples of 3 and the list of multiples of 4. To remove them completely, subtract their count twice.
Solution
1. Count each kind of multiple from to .
- Multiples of : remainder , so there are .
- Multiples of : remainder , so there are .
- Multiples of : remainder , so there are .
2. Where are the multiples of ? A multiple of , like , is a multiple of and a multiple of . So it was counted once in the and once more in the .
3. Remove them. We want no multiples of at all. Each one was counted twice, so subtract twice:
The answer is .
Why this works
Picture two overlapping circles: multiples of and multiples of . The overlap is the multiples of . Adding the two circles counts the overlap twice. For " or " you subtract it once, but for " or but not " you want the overlap gone completely, so you subtract it twice.
Alternative approach
Look at blocks of . From to , the good numbers are : five of them ( itself is left out). Every block of numbers repeats this pattern. There are full blocks up to , giving . The last number, , is not a multiple of or , so it adds nothing.
Concise solution
A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.
Count each kind of multiple up to :
A multiple of is a multiple of both and , so it appears in both of the first two counts. We want such numbers removed completely, so we must take them out twice:
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)
- Intermediate Counting & Probability, Chapter 3: A Piece of PIE (§3.2, §3.3)
- Introduction to Number Theory, Chapter 5: Divisor Problems (§5.2, §5.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.