Atelier des rouesLab FR
Research/Exact enumeration
Exact enumeration

Reconstructing rare gaps by reflection

I exploit the symmetry of a gap to reconstruct its starts and count the representatives required.

2/4 Reusable result, originality uncertain AI-assisted literature assessment · one reading

I identify a useful implementation lemma: reflection pairs departure addresses, so constructing one representative per orbit takes (T+J)/2 reconstructions when J addresses are fixed. Holt and Rudd already study symmetries in sieve gap cycles; the local step is applying that symmetry to fibre-counter preparation. This could reduce work for rare queries, but the overall gain is unestablished. I would benchmark preparation, memory, reconstruction, and sorting together.

Fred B. Holt and Helgi Rudd, Eratosthenes Sieve and the Gaps between Primes · Paul Pritchard, Explaining the Wheel Sieve

How I rate results

Two addresses from one descent

I seek starts of an exact gap g on the wheel of period R. Both endpoints must be units and all interior positions must be excluded. The reflection τ(x)=(−g−x) mod R exchanges endpoints and reverses the holes. Negation preserves coprimality, so τ is an involution on starts, including the gap crossing the period boundary.

For a presieve base B dividing R, reflection sends fibre r to r′=(−g−r) mod B. If r<r′ I prepare a completion counter only for r and reflect each recovered address. If r=r′ I process the whole fibre once. Paired fibres are disjoint and reflection is bijective.

AT.M1. With T starts and F starts in stable fibres, I need (T+F)/2 unranking calls. Paired fibres account for (T−F)/2 and stable fibres for F. The same proof applies when reflection preserves both required and forbidden offset sets separately. Sorting the full output still takes O(T) storage.

Reproducing a rare event

At level 67 and gap 152 there are three admissible endpoint fibres at my base. Two counters suffice, including one for an empty stable fibre. 72 descents recover all 144 starts. For the five test pairs (59,118), (61,132), (67,148), (67,150), (67,152), the output sizes are 60, 12, 12, 16, 144 and each sorted list matches its certificate. I also compared 64 small cases with independent GCD enumeration. In one local run at 67, the folded and full computations took about 1.59 and 2.65 seconds including preparation and sorting. Call counts are reproducible, timings depend on the host.

The symmetry of the wheel gap cycle appears explicitly in Holt and Rudd’s remark 2.2. My algorithm uses that symmetry before preparing the counters and states which savings survive in stable fibres. An identical earlier algorithm remains to be checked before claiming priority. Holt and Rudd · Holt · Small-wheel lab

Refining stable fibres

Within a stable fibre I split by the next prime. Two child fibres exchanged by τ require one reconstruction. I recurse into a stable child. At the last level I check the holes explicitly at the fixed address. Every pair of distinct addresses first separates at some level because the full residue tuple determines its address. There I reconstruct one and reflect it to obtain the other. Each fixed point is handled once.

For T starts and J fixed full-period addresses, I therefore construct (T+J)/2 representatives, counting the terminal check of a fixed point. In AT.M1, F counted all starts in base-stable fibres, including members of nontrivial pairs.

I compared complete output lists with independent enumeration at levels 2, 3, 5, 7, 11 and 13 for gaps 1 through 18, 108 cases. On period 210, gap two has 15 starts, eight representatives and one fixed point. Gap six has 14 starts, seven representatives and no fixed points. Preparing more small counters can cost extra time. My next benchmark will measure setup, memory and total time on matched rare queries. AT.M2 and experiment · Holt and Rudd

Two reflection centres for every even period

For the units of any even modulus R ≥ 4 I can give the fixed-start count J before traversal. A gap of length g starting at x is fixed when 2x+g ≡ 0 modulo R. Its midpoint lies on one of two axes on the circle, 0 or R/2. At zero the nearest units are −1 and 1. If 4 divides R then R/2±1 are odd and coprime to R. If R ≡ 2 modulo 4, R/2 is odd and greater than one, R/2±1 are even, and R/2±2 are coprime to R. Each axis therefore lies inside a unique gap. These are the only fixed gaps. There are two of length two if 4 divides R, and one of length two and one of length four otherwise.

Symmetry and central gaps of primorial wheels appear in Holt and Rudd. I reuse that observation in the AT.M2 count (T+J)/2 and give the argument here for every even R ≥ 4. I checked every even period from 4 to 500. Holt and Rudd, remark 2.2 · AT.M3

Reproduce the experiment

In Atelier, run python miroir.py 67 152 for the original fibre method and its 144 sorted addresses. The pattern starter kit implements the recursive refinement. Run python experience.py in Applications/motifs for the latest result.

Download research files ↓

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.