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.

Printable View

- Dec 14th 2009, 04:55 AMjmedsydivisibility/combinations problem
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. - Dec 14th 2009, 06:22 AMSirOJ
I just wrote up a quick java algorithim to solve this and got 544 numbers divisible by 3,5, or 7 if that's any use to you...

- Dec 14th 2009, 06:38 AMPlato
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 $ - Dec 14th 2009, 04:17 PMjmedsy
- Dec 14th 2009, 04:26 PMPlato
- Dec 14th 2009, 04:29 PMjmedsy
- Dec 14th 2009, 05:19 PMPlato
You must understand the

princple to understand the solution.*inclusion/exclusion*

$\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|$ - Dec 14th 2009, 05:24 PMjmedsy