Quote:
Originally Posted by rogue
I will table your other suggestions because I don't understand them.

I am suggesting using a few more primes, other than 2, like 3,5,7,13 etc (Covering sets)
The code below is from mtsieve for prime 2.
Code:
// If the base is odd, then all n must be even and thus the difference
// between any two remaining n for the base must also be even.
if (idx > 2 && ii_Base & 1)
{
if (idx & 1)
continue;
avx_set_16a(powers[idx2]);
avx_set_16b(powers[2]);
avx_mulmod(dps, reciprocals);
avx_get_16a(powers[idx]);
}
else
{
avx_set_16a(powers[idx1]);
avx_set_16b(powers[1]);
avx_mulmod(dps, reciprocals);
avx_get_16a(powers[idx]);
}