// runlen.js -- solveathome job #7. For known maximal gaps of G2(x#), count L_v, the dead T_v slots // strictly inside the gap (integers s in (pos, pos+G2) with s, s+2 prime to v#), for v = 19 and 23. // A filtered enumeration on base wheel v that inspects runs with L >= THRESH finds a gap only if // L_v >= THRESH; one that inspects only L > THRESH needs L_v > THRESH. A maximum with L_v = THRESH that // a run did report therefore rules out the strict reading for that run. BigInt trial division only. 'use strict'; const PR = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43]; const slot = (r, x) => PR.every(p => p > x || (r % BigInt(p) !== 0n && (r + 2n) % BigInt(p) !== 0n)); const prim = x => PR.filter(p => p <= x).reduce((a, p) => a * BigInt(p), 1n); // least positions from research/exact-g2-ladder.js; the second 43# witness from // research/history/staging/phase1-T2b-exact-ladder.md section 2; mirrors are P - pos - G2 - 2 const CASES = [ { x: 31, g: 348, pos: [8813641451n] }, { x: 37, g: 528, pos: [544899485411n] }, { x: 41, g: 546, pos: [3784200788231n] }, { x: 43, g: 618, pos: [830330079152051n, 1403312099425139n] }, ]; // (v, THRESH) of the reported filtered runs: exact-g2-ladder.js RUNS, plus the v=23 b=37 T=7 run // that phase1-T2b-exact-ladder.md section 1 lists and the script's table does not const RUNS = { 31: [[19, 6], [23, 3]], 37: [[19, 11], [23, 7]], 41: [[19, 12], [23, 9], [19, 11], [23, 7]], 43: [[19, 12], [23, 9]] }; console.log('x G2 position mirror of gap ok L_19 L_23 runs (v/THRESH): L>=T, L>T'); for (const c of CASES) { const P = prim(c.x), g = BigInt(c.g); const all = []; for (const p of c.pos) { all.push([p, '-']); all.push([P - p - g - 2n, String(p)]); } for (const [p, of] of all) { let d = 1n; while (!slot(p + d, c.x)) d++; const ok = slot(p, c.x) && d === g; const L = v => { let n = 0; for (let s = p + 1n; s < p + g; s++) if (slot(s, v)) n++; return n; }; const L19 = L(19), L23 = L(23); const runs = RUNS[c.x].map(([v, T]) => { const Lv = v === 19 ? L19 : L23; return `${v}/${T}: ${Lv >= T ? 'yes' : 'NO'},${Lv > T ? 'yes' : 'NO'}`; }).join(' '); console.log(`${String(c.x).padEnd(4)}${String(c.g).padEnd(5)}${String(p).padEnd(21)}${of.padEnd(21)}` + `${(ok ? 'yes' : 'NO').padEnd(8)}${String(L19).padEnd(6)}${String(L23).padEnd(6)}${runs}`); } }