Find divisible integers from set

21 Views Asked by At

Find the number of integers in the set {1,2...10^3} which are not divisible by 5 nor 7 but are divisible by 3.

My attempt: floor(10^3/3) - floor(10^3/21) - floor(10^3/15) - floor(10^3/105) = 211

Answer shows that its 229.

1

There are 1 best solutions below

1
On BEST ANSWER

You applied inclusion exclusion wrongly it should be

$$\lfloor 10^3/3\rfloor - \lfloor10^3/21\rfloor - \lfloor10^3/15\rfloor + \lfloor10^3/105\rfloor$$