Generates primes by counting