if the imput is, say 11, it has to display the first 11 prime numbers, not prime numbers up until 11.

That requirement is a bit of a problem because there is no formula that yields the number of primes found in an interval (2..n) much less one that given a desired number of primes gives the max of the interval (n) (presuming the interval starts with the first prime.)

if the prime index is limited to 1000 then the array can be limited to 7919 (which is the 1000th prime)

The professor should specify what the highest prime index the problem should handle can be.

Not sure that the teacher will do that, because

1. Pi( n ) ~ n / ln( n )

2. for all n>1 there is at least one prime in [ n+1, 2*n )

So, one could do an estimate for the array size via 1., do the sieving by Erathostenes on that array and count the resulting primes detected. If that is less than the desired number then double the range and sieve the upper half too. This is trivial, because you already know all primes who's multiples have to be evicted from the upper half.

With a very high chance, you'll find the searched for k-th prime in the upper half (if you haven't found it already in the first step).

One could optimise this by a better initial approximation.

If one can not resolve 1. for a good starting point in n, then there is the following simple alternative.

Start with '2', which is the first prime, but not the 11th from the example. Then double the range and sieve by Erathostenes. That should yield '3' as the second prime - still not the 11th. Double and sieve again, which should yield '5' & '7' as 3rd & 4th prime. Etc.

I'm pretty sure the teacher / professor is heading for some dynamic solution.