HI, i am trying to find the first 2000,000 square free semi-prime numbers( mathWorld , oeis). I have generated the prime numbers but to get these semi-prime numbers i am trying as follows:

however on chaging either limit1 or limit2 gives different values for semiprime[200000] . So what should be correct values of these variables?Code:int limit1 = 1000; int limit2 = 2000; for(i=0;i<=limit1;i++) { for(j=i+1;j<=limit2;j++) { semiPrimes[size++]=(primes[i]*primes[j]); } limit2++; }

Thanks.