How many numbers from $1$ to $n$ are there such that a given a set of primes ${p_1, p_2,\ldots,p_k}$ don't divide those numbers from $1$ to $n$?
Take an example: Find how many numbers from $1$ to $5,000,000$ (suppose) are not divisible by any of $2,3,5,7,11,13,17,19$? In the question, the set of primes is some $p_1, p_2, \ldots , p_k$ and not necessarily these $2,3,5,7,11,13,17,19$.
What I have thought is pretty vague for bigger cases as for the example I mentioned.. I thought to do by separating out the ${p_i}$ divisible terms and then add ${p_i p_j}$ divisible terms.. and like that. I am not stating much of my idea as it's just the normal Principle of Exclusion-Inclusion based idea..
if $N$ is a multiple of all the listed primes, the count you want is exactly $$ N \cdot \frac{1}{2} \cdot \frac{2}{3} \cdot \frac{4}{5} \cdot \frac{6}{7} \cdot \frac{10}{11} \cdot \frac{12}{13} \cdot \frac{16}{17} \cdot \frac{18}{19} $$ If your $N$ is not such a multiple, the rational number obtained will just be very close to the correct figure.
Recommend the book by Mark Kac on statistical independence.
In the very special case where $N = p_1 p_2 \cdots p_k,$ with the listed primes $p_i$ distinct, then the numbers up to $N$ that are not divisible by any prime in the list are simply those that are relativley prime to $N,$ and their count is $$ \phi(N) = (p_1 -1)(p_2 - 1)\cdots (p_k-1). $$ For example $$ N = 21. $$ The numbers relatively prime to $21,$ from $1$ to $21,$ but including $1,$ are $$ 1,2,4,5,8,10,11,13,16,17,19,20. $$ These are also the numbers up to $21$ that are not divisible by $3$ or $7.$ There are twelve of them. $(3-1)(7-1) = 2 \cdot 6 = 12.$