For how many $n \in \{ 1 , 2 , \dots , 580 \}$ is $n$ a multiple of one or more of $4$, $6$ or $8$?

68 Views Asked by At

So I believe I want to find the number of integers in the list divisible by 4,6,8 and then subtract the times I double counted the ones which are divisible by more then one.

But I'm not sure how I know how many are divisible by 4,6,8 ?

1

There are 1 best solutions below

1
On

Three hints:

  1. Number of multiples of $k$ in $\{1,2,3,...,n\}$ is $\lfloor\frac{n}{k} \rfloor$
  2. $|A \cup B \cup C| = |A|+|B|+|C|-|A \cap B|-|A \cap C|-|B \cap C|+|A \cap B \cap C|$
  3. Set $A$, $B$ and $C$ will be the sets of multiples of $4$, $6$ and $8$ respectively