Question 174064
A student wants to know how many integers between 1 and 1000 are a multiple of
3 or a multiple of 5. She wonders if it is correct to find the number of those
integers that are multiples of 3 and add the number of those that are multiples
of 5. How do you respond?
<pre><font size = 3 color = "indigo"><b> 
No because if you added those you would be counting all multiples
of 15 twice, because they are both multiples of 3 as well as multiples
of 5. 

Here is what you have to do:

To find the number of multiples of positive integer k between 1 and 
positive integer N of any positive integer:

Divide N by k and take only the integer part.  

So to find the number of multiples of 3 between 1 and 1000,
we divide 1000 by 3, getting 333.3333333, and take the
integer part.  So there are 333 multiples of 3 between 1 and
1000.

To find the number of multiples of 5 between 1 and 1000,
we divide 1000 by 5, getting 200, and taking the integer part, 
we also have 200.  So there are 200 multiples of 5 between 1 
and 1000.

However if we add these 333+200, this number, 533, counts every
integer twice which is both a multiple of 3 as well as a multiple
of 5.

Every integer which is a multiple of 3 as well as a multiple of 5
is also a multiple of 15.  So to figure how many integers we have
counted twince in 533, 

we find the number of multiples of 15 between 1 and 1000,
we divide 1000 by 15, getting 66.66666667, and taking the integer part, 
we get 66.  So there are 66 multiples of 15 between 1 and 1000. 

Since 533 counts these 66 twice, we merely subtract 533-66, getting 
467 which counts them only once.

Actually we used the formula

N(A or B) = N(A) + N(B) - N(A and B)
          = 333  + 200  - 66    
          = 467

where A is the number of multiples of 3 and B is the number of
multiples of 5.

Edwin</pre>