how many different positive integers less than 1000 are divisible by 3 or 5 or 7?
i've got an answer, but i'd like to see another person's approach.
Use the floor function.
$\displaystyle \left\lfloor {\frac{{999}}
{3}} \right\rfloor + \left\lfloor {\frac{{999}}
{5}} \right\rfloor + \left\lfloor {\frac{{999}}
{7}} \right\rfloor - \left\lfloor {\frac{{999}}
{{15}}} \right\rfloor - \left\lfloor {\frac{{999}}
{{21}}} \right\rfloor - \left\lfloor {\frac{{999}}
{{35}}} \right\rfloor + \left\lfloor {\frac{{999}}
{{105}}} \right\rfloor $
You must understand the inclusion/exclusion princple to understand the solution.
$\displaystyle \left| {3 \vee 5 \vee 7} \right| = \left| 3 \right| + \left| 5 \right| + \left| 7 \right| - \left| {3 \wedge 5} \right| - \left| {3 \wedge 7} \right| - \left| {7 \wedge 5} \right| + \left| {3 \wedge 5 \wedge 7} \right|$