Given a list of all composite numbers below 1000, how many will remain after erasure of numbers divisible by 2,3 or 5?
Rem1: "or" is inclusive i.e. and/or.
Rem2: number 1 is neither prime nor composite, so it does not appear on the initial list.
The LCM (Least Common Multiple) or 2,3, and 5 is 30. There are 8 numbers between 1 and 30 that are not divisible by 2, 3 or 5. There are 2 numbers between 1 and 9 that are not divisible by 2, 3 or 5.
999 = 33*30 + 9, so there are 33*8 + 2 = 266 numbers less than 1000 that are not divisible by 2, 3 or 5.
But these include primes. There are 168 primes under 1000, but these include 2,3,and 5. There are therefore 165 primes under 1000 that are not divisible by 2,3,and 5.
266 - 165 = 101, so there are 101 non-primes under 1000 that are not divisible by 2,3, or 5. One of these (1) is neither prime nor composite, and needs to be subtracted out also.
Final answer = 100.