I am not going to tell you the code. But here's the basic algorithm. N=number of primes you want.

Set up a counter (M). Initialised to 0.

Set up an array (A) of length N. Initialise all to zero.

Set up a moving test number (T), moving denominator=D=2.

Assume that the first 3 numbers in the array are 1, 2, 3. IF N=1, the answer is 1, N=2, IF N=2, answer=(1,2), If N=3, answer is (1,2,3). END programme if N<=3.

Else, start with array space M=4, T=4, D=2 . Maximum D value is trunc[ (T/2)] + 1.

TEST START POINT A Test whether mod(T/D)=whole number. If yes T=T+1; D=2; back to TEST START else (if no) D=D+1, If D< trunc(T/2) + 1,. goto POINT A else (D>= trunc(T2) + 1, so prime number must have been found) Thus If D reaches this value, then A[M]=T; T=T+1; D=2; M=M+1. Now, If M < N+1 then back to TEST START. Else (M has reached maximum, so time to end, break out of loop)