Quote:
Originally Posted by CRGreathouse
Use a weighted sum of the appropriate pi_k.
For example, if you wanted the number of odd 3almostprimes up to x, that's pi_3(x)  pi_2(x/2).

Brilliant thanks. Wierdly I actually thought of something similar while going to sleep last night.
Does this sort of start a chain where pi_2(x/2) needs correcting by subtracting from it pi_1(x/4) etc.?
This would lead to pi_k(x)pi_(k1)(x/2)+pi_(k2)(x/4)pi_(k3)(x/8) ... which you would continue until you have the necessary precision.