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.
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.
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$$