How many positive integers not exceeding are multiples of or but not ?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
Count multiples of 3 or 4 by inclusion-exclusion, then remove only those that are also multiples of 5 by a second inclusion-exclusion with 15, 20 and 60.
Solution
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 .
Why this works
" or but not " is the union of and with the part inside removed, and that removed part is itself a union: . Each union is an inclusion-exclusion with overlaps measured by least common multiples. The number theory is routine; the whole difficulty is organizing the two-layer count without dropping an overlap.
Alternative approach
The pattern repeats with period . In to there are multiples of or , of which are multiples of , leaving . Since , that gives through , plus the qualifying numbers among to (nine of them: ), for .
The trap
Subtracting all 400 multiples of 5 instead of only the multiples of 5 that are also multiples of 3 or 4.
Common mistakes
- Subtracting all 400 multiples of 5 instead of only the multiples of 5 that are also multiples of 3 or 4.
- Forgetting the overlap term (multiples of , or of ) in either inclusion-exclusion step, or computing as .
Techniques
Count the complement and subtract from the total