---
name: erdos542-residue-weights-reproduce
description: Reproduce the exact checks behind "Residue-class weights for Erdős's problem on integers with pairwise least common multiple exceeding n" (Theorems A–D) in exact rational arithmetic.
allowed-tools: Bash(curl *), Bash(python3 *), Bash(pip *)
---

# Reproduce the computer-assisted checks for Erdős problem #542

Needs Python 3.11+ with numpy, scipy and mpmath (`pip install numpy scipy mpmath`).

```bash
B=https://tomo3141592653.github.io/self-driving-ai-prototype/research/erdos542-weights
for f in verify_res2.py vk_res.py v2_bounded.py v2_certify.py cert_objective.py primal_lb.py; do curl -LO $B/scripts/$f; done
for f in rfull_N6_r8_J30_u24.npy vk_res_N6_K40.json; do curl -LO $B/data/$f; done
curl -LO $B/SHA256SUMS

# Theorem A: N = 6 weights times 1.00037, exact sweep of ~23 million breakpoints (a few minutes, a few GB of memory)
python3 verify_res2.py 6 8 30 24 1.00037            # last line: 結論: R(x) ≤ 1.00377371 + o(1)
python3 cert_objective.py npy rfull_N6_r8_J30_u24.npy 6 8 30 1.00037   # interval bound for B_N(h) and L_d

# Theorem D (K = 40): finite threshold, then dual certificates / exhaustive search
python3 cert_objective.py json vk_res_N6_K40.json   # C = 495.098337, n0 <= 53126.47
python3 v2_bounded.py 6 40 --list-only > list.txt   # n > 53128: T(n) < 1; 183 values of n left
python3 v2_certify.py 40 --from-log list.txt        # only [2,3,5] (n=5) and [3,4,5,7,11] (n=11)
curl -LO $B/scripts/check_certs.py && python3 check_certs.py v2_certs_K40.json   # 144 certificates, no failures

# Theorem B: dual function for weights depending on m/n alone
python3 primal_lb.py 64 40                          # rational lower bound 1.0096916525, max P = 1 to 12 digits
```

## What to check

- Every `d=` line of `verify_res2.py` ends with `OK`, and the conclusion line prints the bound.
- `v2_certify.py` lists exactly the two exceptional sets; the certificate file `v2_certs_K40.json` it writes contains, for each n ≥ 40, rational y_m with Σ_k y_{ka} ≥ 1/a for all n/40 < a ≤ n and Σ y_m < 1.
- Theorem C (`python3 vk_res.py 6 8 300 300`, slower) prints `rigorous V_N(K) ≤ 0.998405812`.
