How many numbers from 1 to 1000 are there which are NOT divisible by any of the digits 2, 3 and 5 ?
166
266
357
366
Answer is Right!
Answer is Wrong!
This question was previously asked in
UPSC CAPF – 2015
Using the Principle of Inclusion-Exclusion:
Total numbers = 1000
Let A be the set of numbers divisible by 2, B by 3, C by 5.
|A| = floor(1000/2) = 500
|B| = floor(1000/3) = 333
|C| = floor(1000/5) = 200
|A ∩ B| (divisible by 6) = floor(1000/6) = 166
|A ∩ C| (divisible by 10) = floor(1000/10) = 100
|B ∩ C| (divisible by 15) = floor(1000/15) = 66
|A ∩ B ∩ C| (divisible by 30) = floor(1000/30) = 33
Number of elements divisible by at least one of 2, 3, or 5 is:
|A U B U C| = |A| + |B| + |C| – (|A ∩ B| + |A ∩ C| + |B ∩ C|) + |A ∩ B ∩ C|
= 500 + 333 + 200 – (166 + 100 + 66) + 33
= 1033 – 332 + 33 = 701 + 33 = 734
The number of numbers NOT divisible by any of the digits 2, 3, and 5 is:
Total Numbers – |A U B U C| = 1000 – 734 = 266.