generate first n primes function