How many three digit numbers are not divisible by 3, 5, or 11?
How can I solve this?
Should I look to the divisibility rule or should I use, for instance,
$$
\frac{999-102}{3}+1
$$
combinatoricsdiscrete mathematicsdivisibility
How many three digit numbers are not divisible by 3, 5, or 11?
How can I solve this?
Should I look to the divisibility rule or should I use, for instance,
$$
\frac{999-102}{3}+1
$$
Best Answer
Assuming that you mean by either $3$ or $5$ or $11$, use inclusion/exclusion principle:
Amount of numbers with at most $3$ digits that are not divisible by $3$ or $5$ or $11$:
$999-\lfloor\frac{999}{3}\rfloor-\lfloor\frac{999}{5}\rfloor-\lfloor\frac{999}{11}\rfloor+\lfloor\frac{999}{3\times5}\rfloor+\lfloor\frac{999}{3\times11}\rfloor+\lfloor\frac{999}{5\times11}\rfloor-\lfloor\frac{999}{3\times5\times11}\rfloor=485$
Amount of numbers with at most $2$ digits that are not divisible by $3$ or $5$ or $11$:
$99-\lfloor\frac{99}{3}\rfloor-\lfloor\frac{99}{5}\rfloor-\lfloor\frac{99}{11}\rfloor+\lfloor\frac{99}{3\times5}\rfloor+\lfloor\frac{99}{3\times11}\rfloor+\lfloor\frac{99}{5\times11}\rfloor-\lfloor\frac{99}{3\times5\times11}\rfloor=48$
Amount of numbers with exactly $3$ digits that are not divisible by $3$ or $5$ or $11$:
$485-48=437$