Question Number 154301 by joki last updated on 16/Sep/21
$$\mathrm{of}\:\mathrm{the}\:\mathrm{integers}\:\mathrm{101}\:\mathrm{to}\:\mathrm{400}\:\left(\mathrm{including}\:\mathrm{101}\:\mathrm{and}\:\mathrm{400}\:\right. \\ $$$$\left.\mathrm{themselves}\right)\:\mathrm{how}\:\mathrm{many}\:\mathrm{are}\:\mathrm{not}\:\mathrm{divisible}\:\mathrm{by}\:\mathrm{3}\:\mathrm{or}\:\mathrm{5}? \\ $$
Answered by mr W last updated on 16/Sep/21
$$\mathrm{400}−\mathrm{100}=\mathrm{300}\:{numbers} \\ $$$${divisible}\:{by}\:\mathrm{3}:\:\lfloor\frac{\mathrm{400}}{\mathrm{3}}\rfloor−\lfloor\frac{\mathrm{100}}{\mathrm{3}}\rfloor=\mathrm{100} \\ $$$${divisible}\:{by}\:\mathrm{5}:\:\lfloor\frac{\mathrm{400}}{\mathrm{5}}\rfloor−\lfloor\frac{\mathrm{100}}{\mathrm{5}}\rfloor=\mathrm{60} \\ $$$${divisible}\:{by}\:\mathrm{15}:\:\lfloor\frac{\mathrm{400}}{\mathrm{15}}\rfloor−\lfloor\frac{\mathrm{100}}{\mathrm{15}}\rfloor=\mathrm{20} \\ $$$$\Rightarrow\mathrm{300}−\mathrm{100}−\mathrm{60}+\mathrm{20}=\mathrm{160} \\ $$