#!/usr/bin/env python3 """Job #1896: does the Tao 2014 FGKMT post contain the passage that return #32's search record (`lit-check-2026-09-11.md` section 5) attributes to it? Claim under test (search record, item 5): the post "discusses a 'shifted sifting' generalization of the Jacobsthal problem (a finite set A and a translate A+c fully divisible by a prime set P), and remarks that taking A = {n(n+2): n in [z,z^2-2]} with P the primes below z would, if answered negatively, be related to the twin prime conjecture". Method: fetch the post once with an explicit UA, save the raw bytes, then count candidate phrases over the raw HTML (comments included) and print bounded context for each hit. Deterministic output; no timing in stdout. """ import json import pathlib import re import urllib.request URL = "https://terrytao.wordpress.com/2014/08/21/large-gaps-between-consecutive-prime-numbers/" HERE = pathlib.Path(__file__).resolve().parent req = urllib.request.Request(URL, headers={ "User-Agent": "Mozilla/5.0 (compatible; solveathome-research/1.0)", "Accept": "text/html,application/xhtml+xml"}) with urllib.request.urlopen(req, timeout=60) as r: html = r.read().decode("utf-8", "replace") (HERE / "tao2014.html").write_text(html, encoding="utf-8") text = re.sub(r"<[^>]+>", " ", html) text = re.sub(r"&(?:#\d+|[a-z]+);", " ", text) text = re.sub(r"\s+", " ", text) PATTERNS = { "n(n+2) tuple": r"n\s*\(?\s*n\s*\+\s*2", "(n+2)": r"\(\s*n\s*\+\s*2\s*\)", "A + c translate": r"(?:translate|translat\w*)\s+(?:A|set)\s*\+|A\s*\+\s*c\b", "shifted sift": r"shifted\s+(?:sift|generaliz|general is)|shifted sifting", "finite set A": r"finite set\s+A", "twin": r"twin[ -]?prime", "Jacobsthal": r"Jacobsthal", "parity problem": r"parity problem", "admissible tuple": r"admissible\s+(?:prime\s+)?tuple", } out = {"url": URL, "html_bytes": len(html.encode()), "text_bytes": len(text.encode()), "hits": {}} for name, pat in PATTERNS.items(): ms = list(re.finditer(pat, text, re.I)) ctx = [] for m in ms[:3]: a, b = max(0, m.start() - 90), min(len(text), m.end() + 130) ctx.append(text[a:b]) out["hits"][name] = {"count": len(ms), "context": ctx} # the claim needs the conjunction: a translate-form shifted-sift AND the twin tuple out["claim_supported"] = bool(out["hits"]["shifted sift"]["count"] or out["hits"]["A + c translate"]["count"] or out["hits"]["finite set A"]["count"] or out["hits"]["n(n+2) tuple"]["count"]) out["twin_mentioned"] = out["hits"]["twin"]["count"] > 0 out["four_author_opening"] = bool(re.search(r"Kevin Ford, Ben Green, Sergei Konyagin, and myself", text)) out["five_author_fgkmt_cited"] = bool(re.search(r"Long gaps between primes", text)) print(json.dumps(out, indent=1, ensure_ascii=False))