# divisibility/combinations problem

• December 14th 2009, 05:55 AM
jmedsy
divisibility/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.
• December 14th 2009, 07:22 AM
SirOJ
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...
• December 14th 2009, 07:38 AM
Plato
Quote:

Originally Posted by jmedsy
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.
$\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$
• December 14th 2009, 05:17 PM
jmedsy
Quote:

Originally Posted by Plato
Use the floor function.
$\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$

• December 14th 2009, 05:26 PM
Plato
Quote:

Originally Posted by jmedsy

Do you fully understand the inclusion/exclusion principle?
• December 14th 2009, 05:29 PM
jmedsy
Quote:

Originally Posted by Plato
Do you fully understand the inclusion/exclusion principle?

my professor skipped a few lessons in order to make time for the final. in doing that I think he may have avoided teaching this. what's the inclusion-exclusion principle?

my answer was that sum, but without the final term
• December 14th 2009, 06:19 PM
Plato
You must understand the inclusion/exclusion princple to understand the solution.
$\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|$
• December 14th 2009, 06:24 PM
jmedsy
Quote:

Originally Posted by Plato
You must understand the inclusion/exclusion princple to understand the solution.
$\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|$

found it several chapters ahead, thanks. i'll be moving on to my isbn problem which has a thread in the discrete math section. please have a look at it.