I have identified the bottleneck in my code, and I was hoping for some advice on how to get the code running more quickly/efficiently.

for(s = 0; s < start.size(); s++){
    inc = factor_base_index[s];
    mpz_set_ui(base2, inc);
    sz = mpz_sizeinbase(base2, 2);
    for(st = start[s]; st < 262144; st += inc){
        //increment the zero array by ~log2(inc)
        mpz_add_ui(zero[st], zero[st], sz);
The bold line is where the majority of the work is being done.

All this is doing is taking a prime number, storing it in the variable inc, finding the number of bits in inc, and incrementing the array 'zero' by the number of bits.

Any help would be really appreciated