# beta1435.py -- independent recomputation of Face 1's anchored bias beta(x) = S(x)/E(x) of paper/wall-note.md (job #1435). # Definitions read from the note (Face 1) and the pending revision #940: W = x#, y = the largest prime <= sqrt(W); the # Natal@5 comb = residues 11, 17 (mod 30); S(x) = #{r in [0, W) : r = 11 or 17 (mod 30), no prime 7 <= q <= y divides r or r+2} # (the comb slots surviving every scour prime at the anchored phase {0, -2}); E(x) = (2/30) W prod_{7<=p<=y}(1 - 2/p). # S is computed by a direct sieve on [0, W) (feasible for x <= 23, W <= 2.2e8); beta = S/E compared with the table # 1.156, 1.146, 1.009, 0.955, 0.926, 0.893 at x = 7, 11, 13, 17, 19, 23. import math, json import numpy as np def primes_to(n): b = np.ones(n + 1, dtype=bool); b[:2] = False for q in range(2, int(n ** .5) + 1): if b[q]: b[q * q::q] = False return [int(p) for p in np.flatnonzero(b)] out = {} for x in (7, 11, 13, 17, 19, 23): W = 1 for p in primes_to(x): W *= p y = max(p for p in primes_to(int(math.isqrt(W)) + 1) if p * p <= W) ok = np.zeros(W, dtype=bool); ok[11::30] = True; ok[17::30] = True for q in [p for p in primes_to(y) if p >= 7]: ok[0::q] = False; ok[(q - 2) % q::q] = False S = int(ok.sum()); E = (2 / 30) * W for p in [p for p in primes_to(y) if p >= 7]: E *= (1 - 2 / p) out[str(x)] = dict(W=W, y=y, S=S, E=E, beta=S / E) print(f"x={x:>2} W={W:>10} y={y:>5} S={S:>9} E={E:.2f} beta={S / E:.4f}") json.dump(out, open('beta1435.json', 'w'), indent=1)