Closed form of the sieve of Eratosthenes

37 Views Asked by At

I was messing around with this sieve, and I started thinking, could one find a closed form of such a sieve? And this sieve SCREAMED inclusion-exclusion principle. So after using this principle, I obtained the following:

Let $\mathcal P$ denote the set of all primes $\leq x$. Then we have |$\mathcal P$|=[$x$]-$\lfloor \frac{x}{p_1} \rfloor$-$\lfloor \frac{x}{p_2} \rfloor$+$\lfloor \frac{x}{p_1p_2} \rfloor$+..., and we continue until we have added up all possible products of the primes, and subtracted all of the $\lfloor \frac{x}{p_i} \rfloor$. (We must also have that the maximum prime in this sequence must not exceed $\sqrt x$).

Would this be a correct way for writing the sieve?