added function for n-primes