create an array of prime numbers and returns nth prime