0

For one of the problems I am currently trying to solve, I am to determine the number of multiples of 3, 5 and 7 that are between 0 and 1000. Also, I am to do the same for each combination of the three numbers which would then include:

$$ M(n_1, n_2, ..., n_m) \text{ - Number of multiples of } n_i \text{ between 0 and 1000} \\ M(3) = ? \\ M(5) = ? \\ M(7) = ? \\ M(3, 5) = ? \\ M(3, 7) = ? \\ M(5, 7) = ? \\ M(3, 5, 6) = ? $$

Is there an equation that I can use to determine this and if so, how does it work?

1 Answers1

1

The way to go for solving this question would be to use the inclusion-exclusion principle.

Here, $$M(3,5,7) = M(3) + M(5) + M(7) - M(3,5) - M(5,7) - M(3,7) + M(3,5,7)$$ where $M(a,b,… z)$ indicates the number of common multiples between a given range of numbers of $a,b,…z$.

  • But how do I know how many multiples of a number there are between the given range? – Omari Celestine Dec 27 '17 at 12:26
  • 1
    @OmariCelestine See here: https://www.quora.com/How-do-I-find-the-number-of-multiples-of-a-given-number-between-a-range-of-numbers –  Dec 27 '17 at 12:42