I am looking for a general forumla to count prime numbers on which the Meissel and Lehmer formula are based:

$$\pi(x)=\phi(x,a)+a-1-\sum\limits_{k=2}^{\lfloor log_{p_{(a+1)}}(x) \rfloor}{P_k(x,a)}$$

Wiki - prime counting - Meissel Lehmer

More precisely, I am looking for the detailed description of the $P_k$ for $k>3$.

$P_k(x,a)$ counts the numbers$\leqslant x$ with exactly $k$ prime factors all greater than $p_a$ ($a^{th}$ prime), but in the full general formula, this last condition is not necessary.

The Meissel formula stops at $P_2$ (and still uses some $\phi$/Legendre parts)

Wolfram - Meissel

The Lehmer formula stops at $P_3$ (and still uses some $\phi$/Legendre parts)

Wolfram - Lehmer

I don't find anything about the general formula (using all the $P_k$ terms). Is there any paper on it? Why stop at $P_3$? is it a performance issue?

Lehmer vaguely talk about it in his 1959 paper

On the exact number of primes less than a given limit

Deleglise talks about performances here

Prime counting Meissel, Lehmer, ...

Thanks

Edit: by "a general formula on which the Meissel and Lehmer formula are based", I meant the one they tend to (with all $P_k$), not the one they started from (Legendre, with no $P_k$). Sorry if it was not clear.