#include "header.h" /* Tests divides the input n by values of i (incrementing by 1 each time) untill it finds a divisor. Returns the lowest divisor. */ int LeastDivisor(int n){ int i=2; int sqrtn = (int) (sqrt((double) n))+2; while(i0){ i++; //printf("%d\n",i); } return i*i; } int NextPrime(int p){ int i=p+1; while(LeastDivisor(i) < i){ i++; } return i; }