#!/usr/bin/env python3 """job 2774: maximality of the two winning windows, the F=7 rows, and the per-slot killer labels of W. python3 witness2774.py rows-U1.json rows-U2.json """ import json, math, sys for fn in sys.argv[1:3]: d = json.load(open(fn, encoding="utf-8")); U = d["U"]; r0 = d["rows"][0]; L = r0["modulus"]; P = 210 def alive(y): return math.gcd(y % L, P) == 1 and math.gcd((y + 2) % L, P) == 1 def kU(y): return any(y % q == 0 or (y + 2) % q == 0 for q in U) y = r0["first_slot"] - 1 while not alive(y): y -= 1 z = r0["last_slot"] + 1 while not alive(z): z += 1 print("U", U, "K", r0["K"], "window", r0["first_slot"], r0["last_slot"], "prev alive slot killed:", kU(y), "next alive slot killed:", kU(z)) for r in d["rows"]: if r["F"] > r["nU"]: print(" F>|U|:", "R", r["R"], "E", r["E"], "A", r["A"], "Me", r["M_e"], "marg", r["marginal"], "J", r["J"], "S", r["S"], "frags", r["frags"], "A7rhs", r["A7_rhs"], "refined", r["refined_rhs"]) slots = []; x = r0["first_slot"] while len(slots) < r0["K"]: if alive(x): slots.append(x % L) x += 1 print(" W killers:", [[q for q in U if s % q == 0 or (s + 2) % q == 0] for s in slots])