"""Job 4286 (route 112 step check): what the record already fixes about the P=2310 |R|=5 class. Reads #1806's served route112-P210-class.json (sha-checked; fetched from the public files endpoint unless a local copy is given as argv[1]). No K* is computed here. Object: K*(P,R) = maximal cyclic run of consecutive twin slots mod P (gcd(r,P)=gcd(r+2,P)=1) each killed by some q in R (r = 0 or -2 mod q), over the period M = P*prod(R). Proven inequalities used (both accepted on #1267): right leg K*(P*p, R) <= K*(P, R u {p}) - 1 drop floor K*(P*p, R) >= K*(P, R) - floor(2*K*(P, R)/p) Stdlib only, no credential, ~1 s. """ import hashlib, json, sys, urllib.request from math import prod SHA = "02b36b00075b861c19bd59b9decdfebe02af5f76a3a4c2633c8b45eec61b160d" raw = open(sys.argv[1], "rb").read() if len(sys.argv) > 1 else \ urllib.request.urlopen("https://solveathome.org/files/" + SHA, timeout=60).read() assert hashlib.sha256(raw).hexdigest() == SHA t = json.loads(raw) K210 = {tuple(sorted(r["R"] + [r["q"]])): r["C"] for r in t["rows"]} # |R|=6 values, P=210 A210 = {tuple(r["R"]): r["A"] for r in t["rows"]} # |R|=5 values, P=210 K210[(11, 13, 17, 19, 23, 31)] = t["cross_check_1398"]["q=31"] P, p = 2310, 11 U = [13, 17, 19, 23, 29, 31] # six smallest primes not dividing 2310 out = {"input_sha256": SHA} # (1) C does not depend on q: in every row R = U \ {q}, so R u {q} = U and C = K*(2310, U). out["C_is_one_number"] = all(sorted([q] + [x for x in U if x != q]) == U for q in U) # (2) moduli against the step's own cap 1e10 and its "11x" claim MU = P * prod(U) M210 = 210 * prod(t["U"]) out["M_2310_U"] = MU out["M_ratio_vs_P210_U"] = MU / M210 out["alive_slots_2310_U"] = MU // P * prod(x - 2 for x in (3, 5, 7, 11)) out["rows"] = [{"q": q, "M_A": MU // q, "A_under_1e10": MU // q <= 10**10} for q in U] out["C_under_1e10"] = MU <= 10**10 # (3) forced brackets on A rows from the P=210 record br = [] for q in U: R = tuple(x for x in U if x != q) hi = K210.get(tuple(sorted(R + (p,)))) lo_src = A210.get(R) br.append({"q": q, "R": list(R), "upper": None if hi is None else hi - 1, "lower": None if lo_src is None else lo_src - (2 * lo_src) // p}) out["forced_A_2310"] = br print(json.dumps(out, indent=1))