How Many Numbers $[1,1000]$ divide in $11$ and $3$ but not divide in $5,2,7$

220 Views Asked by At

I`m trying to check how many numbers $[1,1000]$ divide in $11$ and $3$ but not divide in $5,2,7$.
what I did so far is to use Inclusion–exclusion principle:
$$N'=(C_{1}'C_{2}'\dots C_{t}')=N-\sum_{i=1}^{t}N(C)+\sum_{1\leq i\leq j \leq t}N(C_{i}C_{j})-\sum_{1\leq i\leq j\leq k \leq t}N(C_{i}C_{j}C_{k})+\dots+(-1)^t \cdot N(C_{1}C_{2}\dots C_{2})$$
first I checked how much numbers not divide in $5,2,7$
set : $C_{1},C_{2},C_{3}$
$C_{1} \rightarrow$ divide with 2
$C_{2} \rightarrow$ divide with 5
$C_{3} \rightarrow$ divide with 7
now I check all the combinations:
$C_{1} = \big[\frac{1000}{2}\big]=500$
$C_{2} = \big[\frac{1000}{5}\big]=200$
$C_{3} = \big[\frac{1000}{7}\big]=142$ 7 is the lcm of $2,7$
$C_{1}C_{2}=\big[\frac{1000}{10}\big]=100$
$C_{1}C_{3}=\big[\frac{1000}{14}\big]=71$ I am taking the Integer
$C_{2}C_{3}=\big[\frac{1000}{35}\big]=28$ lcm of $5,7$
$C_{1}C_{2}C_{3}=\big[\frac{1000}{70}\big]=14$
Now after I checked all the combinations I calculate all the numbers:
$$1000-842+199-14=343$$ 1000 is all the numbers $[1,1000]$
I dont know if I am doing right, this is the way to solve it? I would like to get some advice.
thanks!

1

There are 1 best solutions below

2
On BEST ANSWER

Your answer is too large as you seem to ignored the requirement to be divisible by $3$ and $11$. Since $\lfloor \frac{1000}{3 \times 11} \rfloor = 30$, your answer cannot be more than this.

One easy way would be to write down the numbers $33,66,99,\ldots , 990$ and cross out those divisible by $2$, $5$ and $7$. Indeed since all these are coprime, you could use a sieve and cross out every $2$nd, $5$th and $7$th terms.

If you must use inclusion-exclusion, you could work out $$30 - \lfloor \tfrac{30}{2} \rfloor - \lfloor \tfrac{30}{5} \rfloor - \lfloor \tfrac{30}{7} \rfloor + \lfloor \tfrac{30}{2 \times 5} \rfloor + \lfloor \tfrac{30}{2 \times 7} \rfloor + \lfloor \tfrac{30}{5 \times 7} \rfloor - \lfloor \tfrac{30}{2 \times 5 \times 7} \rfloor.$$