Calculating all primes to a given number