// ============================================================================ // ATTACK-X-OFFSET 03 — THE COFACTOR-ONE LAYER: A DERIVED ENRICHMENT LAW // (2026-08-20 — TODO item X: the first exactly-derived component of the // joint-deficit census) // ============================================================================ // WHY. The mixed super-W census behind the ~3.8 law counts, among other // things, natal r that carry a scour PAIR divisor d = q₁q₂ with d close to W. // For d ∈ (W/2^{s+1}, W/2^s] with 2^{s+1} below the smallest scour prime, the // ONLY multiple of d in [0,W) that can be natal is r = d itself (the cofactor // m must be a unit mod 30 with no prime factor ≤ x, and the smallest such // m > 1 is the smallest scour prime). On that layer the smooth CRT model — // the census's denominator — spreads natal density (2/30)·∏_{7≤p≤x}(p−2)/p // uniformly, but r = d is a product of two primes > x, hence automatically a // unit mod 30 (2/8 chance of landing on the 11/17 line) and automatically // coprime to every base prime (so only the r+2-side condition bites, at // (p−2)/(p−1) per prime). DERIVED LAYER LAW: // // #{natal r ∈ strip} = #{pairs q₁q₂ ∈ strip} · (1/4)·∏_{7≤p≤x}(p−2)/(p−1) // // an ENRICHMENT over the smooth model of exactly // // (30/8)·∏_{7≤p≤x} p/(p−1) = ∏_{p≤x} p/(p−1) → e^γ·ln x (Mertens). // // This is the mechanism of the census's far-super-W SURPLUS (the negative-D // octaves of `research/attack-x-offset-02-profile.js`): the small-cofactor // layers are natal-enriched by a factor growing like e^γ ln x, they push J // UP, and they are exactly derivable. The bulk deficit is the opposing // component; 1 − J = 4S₂ fits the NET. This file tests the layer law to the // integer at four strips per level, @19 through @31. // // WHAT THE UNIFORMITY ASSUMPTION IS. The derivation treats q₁q₂ as // equidistributed over the 8 units mod 30 and over the (p−1) nonzero classes // mod each base prime, jointly. The test below is therefore also a // measurement of that equidistribution at the strip population. // // UNITS. Counts and their ratios; no σ is attached — both sides are exact // integers/arithmetic, and the reported quantity is the relative deviation. // // node research/attack-x-offset-03-cofactor.js // ============================================================================ 'use strict'; const T00=Date.now(); const el=()=>((Date.now()-T00)/1000).toFixed(1)+'s'; const say=(s)=>process.stderr.write(s+'\n'); const f=(v,d=4)=>Number.isFinite(v)?v.toFixed(d):String(v); function primesUpTo(n){const s=new Uint8Array(n+1),o=[];for(let i=2;i<=n;i++){if(!s[i]){o.push(i);for(let j=i*i;j<=n;j+=i)s[j]=1;}}return o;} const NSTRIP=4; // strips s = 0..3: d ∈ (W/2^{s+1}, W/2^s]; 2^4 = 16 < 19 ≤ q_min at every level here console.log('ATTACK-X-OFFSET 03 — the cofactor-one layer: derived enrichment ∏_{p≤x} p/(p−1)'); console.log(`strips s = 0..${NSTRIP-1}: d = q₁q₂ ∈ (W/2^{s+1}, W/2^s], where the only eligible cofactor is m = 1\n`); for(const x of [19,23,29,31]){ const basePs=primesUpTo(x).filter(p=>p>=7); const W=30*basePs.reduce((a,b)=>a*b,1); const qs=primesUpTo(Math.floor(Math.sqrt(W))+1).filter(q=>q>x&&q*q<=W); const K=qs.length; if(2**NSTRIP>=qs[0])throw new Error('strip range collides with the smallest scour prime'); // derived densities const pNatal=0.25*basePs.reduce((a,p)=>a*(p-2)/(p-1),1); // P(natal | r = q1q2) const pSmooth=(2/30)*basePs.reduce((a,p)=>a*(p-2)/p,1); // smooth CRT natal density const enr=basePs.reduce((a,p)=>a*p/(p-1),1)*3.75; // = ∏_{p≤x} p/(p−1) const eGlnx=Math.exp(0.5772156649015329)*Math.log(x); console.log(`===== @${x}: W=${W} K=${K} derived P(natal|layer)=${f(pNatal,6)} smooth=${f(pSmooth,6)} enrichment=${f(enr)} (e^γ·ln x = ${f(eGlnx)})`); // strip loop: for each i, j-range so that q_i q_j ∈ (W/16, W]; classify strip const pairs=new Float64Array(NSTRIP),natal=new Float64Array(NSTRIP); const lo=W/2**NSTRIP; let checked=0; for(let i=0;i i with qi*qs[j] > lo (binary search) let a0=i+1,b0=K; while(a0>1;if(qi*qs[m]>lo)b0=m;else a0=m+1;} for(let j=a0;j=W)break; let s=0,t=W/2; // strip: largest s with r <= W/2^s while(s20000&&i%Math.ceil(K/10)===0)say(` @${x} i=${i}/${K} checked=${checked} [${el()}]`); } let tp=0,tn=0; for(let s=0;s