- I know that $5000$ are divisible by $2$ and $3333$ are divisible by $3$, but this will include repeats.
- I figured out that for numbers divisible by $3$, $1/3$ of them are divisible by $2$, so for the numbers divisible by $3$ that aren't divisible by $2$ will be $2222$.
$5000$ + $2222$ = $7222$ are divisible by $2$ or $3$, giving a final answer of $2778$.
What do you guys think $?$.
Let $M_d = \{\text{integers } n \text{ divisible by } d \text{ such that } 0 < n \leq 10\,000 \}$. Then you're looking for the size of the complement of the set $M_2 \cup M_3$. But, as you've observed, these sets overlap. In fact, $$ | M_2 \cup M_3 | = | M_2 | + | M_3 | - | M_2 \cap M_3 |. $$ What about that last term? You want numbers divisible by $2$ and by $3$, namely those divisible by $6$. (In general, a number is divisible by integers $a$ and $b$ if and only if it's divisible by $\operatorname{lcm}(a, b)$.) So, $M_2 \cap M_3 = M_6$, and $$ | M_2 \cup M_3 | = | M_2 | + | M_3 | - | M_6 |. $$ How big are these sets of multiples? As you've implicitly indicated in your question, $$ | M_d | = \biggl\lfloor \frac{10\,000}{d} \biggr\rfloor, $$ where $\lfloor x \rfloor$ is the floor function that rounds numbers down to the greatest integer $m$ satisfying $m \leq x$. Can you put this all together? Try it yourself before revealing the spoiler: