js: returns a list of n primes