Adding wheel factorization to an indefinite sieve
The odds, i.e. 2-coprimes, are generated by “rolling the wheel” [2], i.e. by repeated additions of 2, starting from the initial value of 3 (similarly from 5, 7, 9, …), n=3; n+=2; n+=2; n+=2; … # wheel = [2] 3 5 7 9 The 2-3-coprimes are generated by repeated additions of 2, then 4, and … Read more