I've seen optimizations to the Sieve of Eratosthenes that (claim to) use "wheel factorization". If the goal is to generate a list of prime numbers up to a certain value, I'm wondering how exactly is wheel factorization used? The Wikipedia article contains some information but it doesn't make sense to me.
For example sieve up to $15$: $\{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15\}$
Starting with 2 strike off multiples $\{1,2,3,\_,5,\_,7,\_,9,\_,11,\_,13,\_,15\}$
Then strike off multiples of 3: $\{1,2,3,\_,5,\_,7,\_,\_,\_,11,\_,13,\_,\_\}$
For wheel factorization with base primes $2$ and $3$ the idea is composites occur periodically with 3 in a row, then one.
So how are these two ideas "merged" when creating a list of prime numbers? Is it just wheel factorization is used to create an initial list of candidates before sieving? But that doesn't seem to save any time because SoE has the pitfall where it strikes off all ready stricken off composites (for example 15 is stricken off on 3 and 15 so what good would wheel factorization of circumference 6 do)?
Is anyone able to provide an example of wheel factorization used with a sieve?
TL;DR how is wheel factorization used with sieving?




Let's say you have the wheel made from the first $3$ prime numbers: $2, 3, 5$. The wheel would consist of all integer $n \in [2, 2\cdot 3\cdot 5 + 1]$ coprime to $2, 3, 5$. Specifically it would be $\{7, 11, 13, 17, 19, 23, 29, 31 \}$.
Let's say you are trying to find all primes under $600$. Then the candidate list of primes would be given by almost $20$ "spins" of the wheel. It would be $\{ 7, 11, 13, 17, 19, 23, 29, 31, 7+30, 11+30, 13+30, 17+30, 19+30, 23+30, 29+30, 31+30..., 599\}$
The cutoff is $599$ here because the next element of $601$ would be above the limit of $600$.
Then the algorithm would be:
The advantage to the plain Sieve of Eratosthenes is in the
set p to next elementstep. Because of the wheel, $p$ would increment faster on average. While for the original sieve, you would have had to increment through every single integer $\ge 2$, now you can increment through only $8/30$ (on average).You may have even used a simple form of wheel factoring in a sieve. Incrementing over the odd numbers is wheel factoring, just with only the first prime number, $2$.