For $n \leq 1000$ I am interested in the integers who are divisible by 4 but not by 3 and 16. Say $a_i$ is the property that an integer is divisible by $i$. Inclusion-Exclusion gives us: \begin{align} N(a_{3}'a_{4}a_{16}') = N - N(a_3) - N(a_4') - N(a_{16}) + N(a_3a_4') + N(a_3a_{16}) + N(a_4'a_{16}) - N(a_{3}'a_{4}a_{16}') \end{align} I can determine those first 4 terms correctly:
• N = 1000
• $N(a_3)= \lfloor \frac{1000}{3} \rfloor = 333$
• $N(a_4')= 1000 - \lfloor \frac{1000}{4} \rfloor = 750 $
• $N(a_{16})= \lfloor \frac{1000}{16} \rfloor = 62$
Now it is becoming harder to working things out. We can say for $N(a_3a_4')$ that those are all the numbers that are divisible by 3 but not by 4. We can again apply inclusion-exlusion on this term but it don't seem to help. How can I work this out?