Question Number 43765 by peter frank last updated on 15/Sep/18
$$\mathrm{The}\:\mathrm{sum}\:\mathrm{of}\:\mathrm{integers}\:\mathrm{from}\:\mathrm{1}\:\mathrm{to}\:\mathrm{100}\:\mathrm{that} \\ $$$$\mathrm{are}\:\mathrm{divisible}\:\mathrm{by}\:\mathrm{2}\:\mathrm{or}\:\mathrm{5}\:\mathrm{is}\:\_\_\_\_\_. \\ $$
Answered by math1967 last updated on 15/Sep/18
$${sum}\:{of}\:{divisible}\:{by}\:\mathrm{2}={S}_{\mathrm{2}} \\ $$$${sum}\:{of}\:{divisible}\:{by}\:\mathrm{5}={S}_{\mathrm{5}} \\ $$$${sum}\:{of}\:{divisible}\:{by}\:{both}\:\mathrm{2}\:{and}\mathrm{5}={S}_{\mathrm{10}} \\ $$$$\therefore{n}\left({S}_{\mathrm{2}} \cup{S}_{\mathrm{5}} \right)={n}\left({S}_{\mathrm{2}} \right)+{n}\left({S}_{\mathrm{5}} \right)−{n}\left({S}_{\mathrm{2}} \cap{S}_{\mathrm{5}} \right) \\ $$$$=\left\{\mathrm{2}+\mathrm{4}+…\mathrm{100}\right\}+\left\{\mathrm{5}+\mathrm{10}+..\mathrm{100}\right\} \\ $$$$\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:−\left\{\mathrm{10}+\mathrm{20}+…\mathrm{100}\right\} \\ $$$$=\frac{\mathrm{50}}{\mathrm{2}}\left(\mathrm{2}×\mathrm{2}+\mathrm{49}×\mathrm{2}\right)+\frac{\mathrm{20}}{\mathrm{2}}\left(\mathrm{2}×\mathrm{5}+\mathrm{19}×\mathrm{5}\right) \\ $$$$\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:−\frac{\mathrm{10}}{\mathrm{2}}\left(\mathrm{2}×\mathrm{10}+\mathrm{9}×\mathrm{10}\right) \\ $$$$\left[{using}\:{S}_{{n}} =\frac{{n}}{\mathrm{2}}\left\{\mathrm{2}{a}+\left({n}−\mathrm{1}\right)×{d}\right\}\right] \\ $$$$=\mathrm{2550}+\mathrm{1050}−\mathrm{550}=\mathrm{3050}{Ans} \\ $$