
/**************** generate the first NN32 primes in A ******************/

void GenLowerPrimes(int *A)
{
 int I,J,K,K12,ODD;

 A[0]=2; A[1]=3; I=2; K=2; K12 = 9; ODD=3;

 LP:
   ODD += 2;
   if (K12<=ODD) {K++; K12=(K+1)*(K+1);} /* adjust K so that K<=SQRT(ODD)<K+1 */
   for (J=1; A[J]<=K; J++)        /* see if any primes div ODD */
     if (!(ODD%A[J])) goto LP;
   A[I]=ODD; I++;                 /* to place the next prime in A[I] */
   if (I<NN32) goto LP;
    A[NN32-1] = 0;  /* EOF marker */
 return;
}
