October 20, 2026
Defeating the Sieve Part 3: The Shield Was Always Symmetric
The worked example that opened this series was wrong. Fixing it turns a rough heuristic into a model with no fitted parameters that lands within a fraction of a percentage point of the data, and leads straight to a conjecture from 1904.
In Part 1 I claimed that twin primes were “exposed” to the number 3: if , then is divisible by 3, so half of all Gap 2 sums get shot down. That was the example the whole series was built on.
It is false. If , then , so is not prime and is not a twin pair. Every twin prime above 3 sits at , which puts the sum at . Gap 2 is never divisible by 3. It is shielded.
Part 2 actually made this exact argument for Gap 14 and called it the Neighbor Shield. I did not notice that it applied to Gap 2 as well, or that it contradicted Part 1. This post is the correction, and the correction turns out to be more interesting than the original claim.
Where the contradiction was
Two things in my own posts could not both be true. Part 1 said Gap 2 is hit by 3 half the time because can be . Part 2 said Gap 14 is safe from 3 because cannot be , or would be divisible by 3. Both gaps are . The same argument applies to both. I had that contradiction in print for ten months and did not see it, because each post was consistent with itself.
The data had been saying the same thing from the start. The old model gave gaps 2, 8 and 26 the identical boost, and the census gave them 9.6%, 11.8% and 14.9%. A model that assigns equal predictions to values that differ by half, while claiming an near 1.0, is not a near-fit with noise. It is a wrong model with a flattering chart. The chart fitted a trendline instead of drawing , and that choice hid the miss.
When data contradicts a model, the fault is an assumption, and it is usually further back than you want to look. The instinct is to patch near the surface: keep the shield rule, add a trap term, call the leftover noise. Part 2 did exactly that. The trap term was correct, and the fit improved, and the broken foundation stayed in place. The right move is to walk the chain of assumptions backwards and test each one against ground truth, including the ones that feel too basic to question. Here the broken link was the very first one, “a twin prime can be ,” and everything built on it was internally consistent and wrong.
Finding it took most of a year, and not because the mathematics is hard. The series went quiet because work and life took the hours. But I kept coming back to it, and each return was the same exercise: re-read the chain from the data to the conclusion, pick the assumption one step further back than I had checked the last time, and test it. For a long while every link I checked held. The one that failed was the first link, in the first paragraph I wrote, the one I had never tested because it did not feel like an assumption at all.
Hard troubleshooting almost always has this shape. You hold two assumptions with confidence, and together they force a scenario that cannot happen. Neither looks wrong on its own, so the temptation is to add a third assumption that reconciles them. Root cause is found the other way: refuse the impossibility, trace every assumption back to something you can check directly, and start with the foundations rather than the clever parts. The clever parts are where you spent your attention. The foundations are where you did not.
The rule I should have written down
Fix an odd prime and a gap . Both parents and are prime, so avoids two residues modulo : it is not , and it is not . The sum is divisible by for exactly one residue of , namely . So the question is whether that one bad residue is among the two the parents already rule out.
- If , that is , the bad residue is already excluded.
- If , that is , the bad residue is already excluded.
Both signs work. The shield condition is , for every odd prime including 3. My original rule used for 3 and for everything else, which is half of the truth at every prime.
There are two more cases, and they explain the low end of the spectrum, which Part 1 ignored entirely. Measured against a random odd integer, which survives with probability :
| Case | Condition | Chance is hit by | Factor |
|---|---|---|---|
| Shield | 0 | ||
| Trap | 1 in | ||
| Neutral | otherwise | 1 in |
The trap row is Part 2’s Mod 3 Trap, and at the factor is , the number I found by hand. The neutral row is new. It is a mild penalty, because the parents exclude two residues from the pool, which makes the one bad residue slightly more likely than it would be for an unconstrained number.
The prediction for a gap is the product of these factors over every odd prime, times the chance a random odd number of the same size is prime, which is .
Gap 4 beats Gap 2 by exactly three halves
Here is the cleanest test the rule offers. Gaps 2 and 4 are both shielded at 3. For every prime from 7 upward, both are neutral, since neither is 0 or modulo anything that large. The only prime that treats them differently is 5: Gap 4 is and shielded, Gap 2 is neutral.
Observed at : . At it was .
The numbers
I rewrote the model in the analyzer, added the size-matched baseline, and reran the census, first at and then, on a faster machine, at : every prime below a trillion, 37.6 billion of them, in about three and a quarter hours. Part 1 claimed an near 1.0 for the old rule. It was not. Over the 121 gaps with at least 100,000 pairs at :
| Model | , predicted vs. observed |
|---|---|
| Old one-sided rule | 0.30 |
| Shield, trap, neutral at every odd prime | 0.997 |
A sample of the spectrum. “Predicted” is the size-matched baseline times the product of local factors, with no fitted parameters.
| Gap | Pairs | Observed | Predicted | Shields | Traps |
|---|---|---|---|---|---|
| 2 | 1,870,585,220 | 0.0796 | 0.0796 | 3 | none |
| 4 | 1,870,585,458 | 0.1194 | 0.1195 | 3, 5 | none |
| 6 | 3,435,528,229 | 0.0749 | 0.0746 | 5, 7 | 3 |
| 8 | 1,573,331,564 | 0.0982 | 0.0995 | 3, 7 | none |
| 12 | 2,753,597,777 | 0.0526 | 0.0492 | 11, 13 | 3 |
| 14 | 1,556,469,349 | 0.1390 | 0.1368 | 3, 5, 13 | 7 |
| 30 | 1,803,413,614 | 0.0490 | 0.0481 | 29, 31 | 3, 5 |
| 34 | 629,634,308 | 0.1710 | 0.1683 | 3, 5, 7, 11 | 17 |
| 94 | 46,375,798 | 0.1366 | 0.1306 | 3, 5, 19, 31 | 47 |
| 210 | 924,563 | 0.0560 | 0.0553 | 11, 19, 211 | 3, 5, 7 |
The misses are small, but with samples in the billions they are not noise. Gap 12 runs about 7% above its prediction and Gap 94 about 5%. That is the expected signature of Hardy–Littlewood secondary terms, which decay slowly as grows, and having three runs makes the decay visible. Here is the relative miss, observed over predicted minus one, for the same gaps at three scales:
| Gap | |||
|---|---|---|---|
| 2 | +0.16% | −0.10% | −0.03% |
| 4 | −0.26% | −0.08% | −0.04% |
| 8 | −2.14% | −1.58% | −1.27% |
| 12 | +11.44% | +8.39% | +6.73% |
| 14 | +2.87% | +2.01% | +1.60% |
| 34 | +2.26% | +1.82% | +1.56% |
| 94 | too few pairs | +5.98% | +4.62% |
| Mean absolute miss, all gaps with 100k+ pairs | 3.05% | 2.55% | 2.31% |
Every residual shrinks as grows, in the direction the theory says it should. Lemke Oliver and Soundararajan saw the same slow convergence in their consecutive-prime data. The ordering of every gap in the table is predicted correctly, including Gap 210 landing below Gap 2 and Gap 30 landing below everything.
The old chart in the report plotted a “boost” with no units against the observed rate and drew a best-fit line through it. The new chart plots the predicted rate against the observed rate with the line . Points that sit on that line are not fitted. They are predicted.
Gap 34, properly counted
Gap 34 was the king of Part 1 as a triple shield against 3, 5 and 7. Under the symmetric rule it is also , so it is a quadruple shield. The clean way to say it: . A gap is shielded by every odd prime up to exactly when is divisible by . It is also , so 17 is a trap for it, worth a penalty of 0.4%.
The sequence of smallest fully shielded gaps under the symmetric rule is 2, 4, 34, 34, 274, 9164, 83656, 937364. It was not in the OEIS, so I submitted it; it is now A401296, defined there as the smallest even with modulo each of the first odd primes. It has a close relative that was already there: A323746, the smallest number as far as possible from every multiple of the first primes. Twice that sequence gives the shielded gaps that are 2 mod 4, and the two agree whenever the smallest shielded gap happens to be 2 mod 4, which is most of the time. The two sequences I expected to be new, the primes for which is prime and the primes that result, were already in the OEIS. The one-sided variant the repository’s Python tool generates, 4, 4, 34, 1924, 25024, 85084, I left unsubmitted, since its sign convention is a choice rather than a property.
That tool is a small example of the same lesson. It finds each term with a ratchet: step forward by the product of the primes already satisfied, which preserves their residues, until the next prime’s residue is hit. I was fond of it. It works because the one-sided rule fixes a single residue per prime, so there is exactly one chain of solutions to follow. The symmetric rule allows two residues per prime, chains, and the smallest solution jumps between them: 34 is , while the next term, 274, is , so a ratchet starting from 34 can never reach 274. The assumption was not in the code’s logic. It was in the choice of algorithm. The replacement enumerates sign patterns with the Chinese remainder theorem, and a meet-in-the-middle split over the primes produces forty terms in about twenty seconds.
This is a conjecture from 1904
I did look for prior work before the first post, but I searched for the problem in my own words: prime sums, gaps, shields. Nothing in the literature uses those words, so nothing came back, and the silence read as novelty. The mechanism has been known for a century under names I had no reason to know: singular series, local factors, prime k-tuples. A search phrased in your own vocabulary can only find your own problem. What would have worked was stepping outside the framing to ask the general question, “is there a known heuristic for how often a linear expression in primes is itself prime,” or asking someone who speaks the field’s language. Either gets you to Hardy and Littlewood in a sentence.
The density of primes among the values of a system of linear forms like , and is the subject of the Hardy–Littlewood prime k-tuple conjecture of 1923, generalized by Bateman and Horn in 1962. Their formula carries one factor per prime , and that factor depends on how many residue classes modulo the three forms jointly rule out. The shield is the case where the third form’s bad residue coincides with one the parents already exclude, so the count is two instead of three and the factor goes up. The trap is the case where the two parents’ excluded residues coincide, so the count drops and the third form pays full price. The table above is that local factor, conditioned on the first two forms being prime, and the baseline is the prime number theorem.
One thing the shield is not, which an OEIS editor corrected me on: it is not an admissibility condition in the sense of Dickson’s 1904 conjecture. Admissibility asks whether some prime blocks every residue class so that no triple can exist at all, and for these three forms no prime ever does, since each excludes at most three classes. Every even gap is admissible. The shield is about how large the density is, not whether it is zero.
The closest modern relative is Lemke Oliver and Soundararajan’s 2016 paper on biases in consecutive primes, which found that the residues of neighboring primes are correlated in surprising ways and explained it with the same Hardy–Littlewood machinery. The shape of this series, an empirical bias in consecutive primes explained by residue counting, is that paper’s shape.
So the mechanism is old. What I could not find anywhere is this particular statistic. Nobody seems to have tallied the primality of by gap, and this census, now to , appears to be the first measurement of it.
Can you use it to find primes?
This was the question I most wanted to answer, so here is the honest version. If you have two consecutive primes at a favorable gap, their sum-minus-one really is two to three times more likely to be prime than a random odd number of its size. That is a real prior, and it is tempting to use it for triage: spend the expensive primality test on the candidate with the best parent gap.
The catch is that the gap carries no information about beyond its residues modulo small primes, and once you have and you have itself and can read those residues off directly. Trial division is the same test, carried out exactly instead of statistically, and it does not stop at 11.
| Screen applied to the candidate | Prior boost over a random odd number |
|---|---|
| Quadruple shield (Gap 34) | about 2.3x |
| No odd prime factor below 100 | about 4x |
| No odd prime factor below | about 12x |
The last row is what every large prime search already does before spending a real test. The shield is a slower route to a weaker version of it. What survives is not a search technique. It is a picture: the sum inherits a residue fingerprint from its parents, and the gap is the thing that encodes it.
What changed in Parts 1 and 2
- Part 1’s Gap 2 example is wrong. Gap 2 is shielded against 3. A correction note now sits at the top of the post.
- Part 1’s “R² ≈ 1.0” was not supported by the old model. The corrected model earns it.
- Both posts said “10 billion primes” and “100 billion primes.” The tool scans integers up to , which contains about 455 million primes.
- Part 2 described a run. The figures in it are from the data, and the post now says so.
- Part 1 said the data “proves” the theory. It is a numerical check of a heuristic that remains unproven for any system of two or more linear forms.
The updated analyzer, with the three-case model, the size-matched baseline, a predicted-versus-observed chart and the full report, is at github.com/johnmschoonover/prime_shield_analyzer.
Why a security engineer spent a year on this
The work I do for a living is detection engineering, and this project is the same job with cleaner data. A detection is a claim that some pattern is rarer in benign traffic than in malicious traffic. The claim is only worth anything if you measure the base rate, check the model against the full distribution instead of the examples that made you excited, and go back and say so when the first version was wrong. Gap 2 was my false positive, and the alert that contradicts your model of the environment is the one worth the most, if you trace the assumptions back instead of tuning the rule until it stops firing. The line is what a calibrated detector looks like. The habit of asking “is this already a known technique” before shipping is the one I most wish I had applied in Part 1.
TL;DR
- The sum of two consecutive primes minus one is prime at a rate that depends strongly on their gap: from 5.6% (Gap 210) to 17.1% (Gap 34) among primes below .
- The rule, per odd prime : a gap is shielded if , trapped if divides , neutral otherwise, with factors , and . The product times predicts the rate with no fitted parameters: , residuals shrinking with .
- Part 1’s Gap 2 example was wrong. Twin primes are shielded against 3. The error survived ten months because each post was consistent with itself.
- The mechanism is Hardy–Littlewood (1923) and Bateman–Horn (1962). The statistic, and the sequence now filed as A401296, appear to be new. The method is not.
- It is not a way to find primes. Trial division on the sum reads the same information exactly, and far deeper.
- When data contradicts a model, trace the assumptions back to the foundations and test them there. The clever parts are not where the fault is.