// new-statistic-degeneracy.js // // QUESTION. two statistics are proposed for the same job: (A) the corner two-point // correlation K(x) = sum_{x/2 { let r = 1n; const B = BigInt(b); for (let i = 0; i < e; i++) r *= B; return r; }; const target = BigInt(x) ** BigInt(p); let guess = Math.max(1, Math.floor(Math.pow(x, p / q))); while (powBig(guess, q) > target) guess--; while (powBig(guess + 1, q) <= target) guess++; return guess; } function primesUpTo(n) { const sieve = new Uint8Array(n + 1).fill(1); if (n >= 0) sieve[0] = 0; if (n >= 1) sieve[1] = 0; for (let i = 2; i * i <= n; i++) if (sieve[i]) for (let j = i * i; j <= n; j += i) sieve[j] = 0; const ps = []; for (let i = 2; i <= n; i++) if (sieve[i]) ps.push(i); return ps; } function smallestPrimeFactor(limit) { // spf[n] = smallest prime factor of n const spf = new Uint32Array(limit + 1); for (let i = 2; i <= limit; i++) { if (spf[i] === 0) for (let j = i; j <= limit; j += i) if (spf[j] === 0) spf[j] = i; } return spf; } function largestPrimeFactor(n, spf) { let m = n, best = 1; while (m > 1) { const p = spf[m]; best = p; while (m % p === 0) m /= p; } return best; } function cornerBand(x) { // (A): primes in (floor(x^(1/20)), floor((x-2)/(E_1+1))], E_1 = floor(x^(93/100)) const Z = exactPowFloor(x, 1, 20); const E1 = exactPowFloor(x, 93, 100); const hi = Math.floor((x - 2) / (E1 + 1)); if (hi <= Z) return { lo: Z, hi, count: 0, primes: [] }; const ps = primesUpTo(hi).filter((p) => p > Z && p <= hi); return { lo: Z, hi, count: ps.length, primes: ps.slice(0, 8) }; } function singletonAdmissible(x, spf, Z) { // (B): v in (x/2, x] with at least one prime factor > Z=x^(1/20). const lo = Math.floor(x / 2) + 1; let ok = 0, total = 0; const examples = []; for (let v = lo; v <= x; v++) { total++; const lpf = largestPrimeFactor(v, spf); if (lpf > Z) { ok++; if (examples.length < 5) examples.push([v, lpf]); } } return { ok, total, frac: ok / total, examples }; } function main() { const rows = []; let spf = null, spfLimit = 0; for (const J of XS) { const x = Math.pow(2, J); const Z = exactPowFloor(x, 1, 20); const A = cornerBand(x); let B = null; if (J <= exactUpTo) { if (spf === null || spfLimit < x) { spf = smallestPrimeFactor(x); spfLimit = x; } B = singletonAdmissible(x, spf, Z); } rows.push({ J, x, Z, A, B }); console.log(JSON.stringify({ J, x, Z, corner_band: { lo: A.lo, hi: A.hi, primes_in_band: A.count, first_primes: A.primes }, corner_admissible: A.count > 1, singleton_exact: B ? { v_total: B.total, v_with_lpf_gt_Z: B.ok, fraction: +B.frac.toFixed(9), examples: B.examples } : null, singleton_admissible: B ? B.ok > 1 : null, })); } } main();