Computes all primes up to and including n.