Prime number what will be size of array

here I have created the program to compute the nth prime number.
here i assume that max_size of the array is 100.
So suppose we have to generate total number of 500000 prime number so how should we decide the what will be the array size. for prime sieve array because we don’t know about that how much array size is required to generate the total nprime number.in case of arr[10] then 2,3,5,7 there are only 4 prime number. What is the approach here