Counts the number of primes below a given number by partitioning ranges to threads.