I am asking myself if instead of working with the primes in the calculation of $\pi(x)$ up to $x$, we instead work with the composite numbers and then using a simple subtraction to get $\pi(x)$. After all it must be much easier to deal with the composite numbers. We only need to look at $x/3$ to get $\pi(x)$ since $2/3$ of the numbers are multiples of $2$ and $3$. So we can write $c(x)+\pi(x) = x/3$ ( and add the $2$ coming from primes $2$ and $3$ ) to get the correct result ( $c(x)$ being of course the number of composite up to $x/3$ not included the multiples of $2$ and $3$ of course).
We know how to produce the composite numbers, but we don't know if a given number is a prime without testing it. What would be wrong with that?