Improved parallel P2(x, a) algorithm

The previous algorithm did not scale at all for small values of x. The
new algorithm scales nicely using even 32 CPU cores.