int main(void) {
    int nprimes =  1000000;
    int nmax =    ceil(nprimes*(log(nprimes)+log(log(nprimes))-0.9385));  
      
      
    int i, j, m, k; int *a;
    k = (nmax-2)/2; 
    a = (int *)calloc(k + 1, sizeof(int));
    for(i = 0; i <= k; i++)a[i] = 2*i+1; 
    for (i = 1; (i+1)*i*2 <= k; i++)
        for (j = i; j <= (k-i)/(2*i+1); j++) {
            m = i + j + 2*i*j;
            if(a[m]) a[m] = 0;
            }            

    for (i = 1, j = 0; i <= k; i++) 
       if (a[i]) {
           if(j%10 == 0 && j <= 100)printf();
           j++; 
           if(j <= 100)printf(, a[i]);
           else if(j == nprimes){
               printf(,j,a[i]);
               break;
               }
           }
}