prime to sqrt(b) is being calculated by the first for loop in int main. What is this function doing (void sieve)