#include "header.h" /* Tests divides the input n by previously computed primes until it finds a prime divisor. Returns this lowest divisor. The primes list is assumed to be initialized to zero and not yet computed primes are identified by this zero value. */ int LeastDivisorB(int n, int * Primes){ int i=0; while(Primes[i]>0 && n%Primes[i]>0){ i++; } return Primes[i]; } int NextPrimeB(int p, int * Primes){ int n = Primes[p]+1; while(LeastDivisorB(n, Primes) >0){ n++; } return n; }