For the sieve of Eratosthenes, let $E_k$ be the number of elements left after removing all primes up to $p_k$ and their multiples from the set $\left\{1,2,3,...p_k\#\right\}$ where $p_k\#=\prod\limits_{i=1}^k p_i$ is the primorial.
Then $E_k$ is given by
$$E_k=p_k\#\ \prod\limits_{i=1}^k \left(1...