How many numbers between 1 and 10000 are multiples of 4 or 5 or 7? How many of those numbers are also multiples of 3?

228 Views Asked by At

I think to find the answer of first questions, I would find $$ \begin{multline} \left\lfloor \frac{10000}{4} \right\rfloor + \left\lfloor \frac{10000}{5} \right\rfloor + \left\lfloor \frac{10000}{7} \right\rfloor \\ − \left\lfloor \frac{10000}{\mathrm{lcm}(4,5)} \right\rfloor - \left\lfloor \frac{10000}{\mathrm{lcm}(5,7)} \right\rfloor - \left\lfloor \frac{10000}{\mathrm{lcm}(4,7)} \right\rfloor - \left\lfloor \frac{10000}{\mathrm{lcm}(4,5,7)} \right\rfloor . \end{multline} $$

However, I'm not sure if I'm doing the second part correctly. Would it just be the answer from the previous questions $${} + \lfloor 10000/3 \rfloor - \lfloor 10000/\mathrm{lcm}(3,4) \rfloor - \lfloor 10000/\mathrm{lcm}(3,5) \rfloor - \lfloor 10000/\mathrm{lcm}(3,7) \rfloor $$ and so on until I get to the $\mathrm{lcm}(3,4,5,7)$?