Precalculate the mods.
Ignore adds already taken into account when eliminating offsets.

Change the speed tests to use a higher value to test the longer code path.
Modify the set of offsets properly.
Only generate odd random numbers.
Check the bit count more frequently.