// t29check.mjs -- spot check of return #161's T29 column at the boundary it names. // // #161 (measured): the T29 column of L(T_x, p) reads 4 at p=31, 3 at p=29 and 37, 2 // through p=113, and 1 from p=127 on. The last step is the one the cross-lane synthesis // leans on (it is what collapses the alternation-refined transport sum to its L=1 term), // so it is checked here on the served definition of L: runFor, verbatim from // research/Lgrowth.js, on the tile T_29 built by iterated fold. // // A single linear scan per prime (O(D)), not trueL's O(q*D) walk: runFor and trueL agree // on all 230 entries ver656.mjs sweeps, and for L=1 both say the same thing -- no two // consecutive slots share a killing 2-set. // // stdout is figures only: no clock, no RNG, no paths. function foldTile(tile, q) { const { slots, W } = tile, D = slots.length; const out = new Float64Array(D * (q - 2)); let n = 0; for (let k = 0; k < q; k++) { const off = k * W; for (let i = 0; i < D; i++) { const v = slots[i] + off; const r = v % q; if (r !== 0 && r !== q - 2) out[n++] = v; } } if (n !== out.length) throw new Error('kill count wrong at q=' + q); return { slots: out, W: W * q, x: q }; } function runFor(S, p) { const okPair = (a, b) => { if (a === b) return true; const d = Math.abs(a - b); return d === 2 || d === p - 2; }; let best = 0, cur = 0, s1 = -1, s2 = -1, last = -1; for (let i = 0; i < S.length; i++) { const r = S[i] % p; let ext = false; if (cur > 0) { if (r === s1 || r === s2) ext = true; else if (s2 === -1 && okPair(s1, r)) { s2 = r; ext = true; } } if (ext) cur++; else { cur = (last >= 0 && okPair(last, r)) ? 2 : 1; if (cur === 2) { s1 = last; s2 = r; } else { s1 = r; s2 = -1; } } last = r; if (cur > best) best = cur; } return best; } let tile = { slots: Float64Array.from([5]), W: 6, x: 3 }; for (const q of [5, 7, 11, 13, 17, 19, 23, 29]) tile = foldTile(tile, q); console.log(' T_29: D = ' + tile.slots.length + ' W = ' + tile.W + ' expected D = 214708725 W = 6469693230'); console.log(' #161 column: L(T_29, p) = 4 at 31, 3 at 29 and 37, 2 through 113, 1 from 127 on'); console.log(' p L(T_29, p) #161'); const REC = { 29: 3, 31: 4, 37: 3, 113: 2, 127: 1, 131: 1, 137: 1, 1009: 1 }; console.log(' building the tile...'); for (const p of [29, 31, 37, 113, 127, 131, 137, 1009]) { const L = runFor(tile.slots, p); console.log(' ' + String(p).padStart(5) + String(L).padStart(12) + String(REC[p]).padStart(7) + ' ' + (L === REC[p] ? 'same' : 'DIFFER')); }