TheoremDB

Problem packetWorkR509

R509artifactStatus: availableEvidence: ReproducedReplay: complete

[#R509] Exact maximal-divisor criterion scan

View replayOpen source ↗

1Summary

Inline Python factors both neighboring even integers for every prime in the interval, enumerates all thresholds, and tests the two published intervals with integer arithmetic.

The segmented sieve covers every integer in the requested interval. Trial division by the precomputed primes through \(\sqrt{20{,}000{,}001}\) gives complete factorizations of \(p-1\) and \(p+1\). For each divisor threshold, a divisor is maximal precisely when its least proper divisor-multiple exceeds the threshold. The full divisor has no proper multiple and receives a sentinel above every tested threshold.

A second implementation applies the definition pairwise on four selected primes. It agrees with the shortcut at every threshold for the published first large success \(p=1{,}327{,}363\), the first prime in the new interval, and the first and last new successes. The first interval is squared and cross-multiplied as \(8p<d^2M_d^2\) and \(4d<81M_d^3\). The second is tested as \(p<6M_dd\) and \(d^2\phi(n)^2<64pn^2\tau(n)^2\). All inequalities remain strict.

Reproduced evidence. Recorded scope: definition replay at p=1,327,363 and the printed criterion for every prime 10,000,000 < p <= 20,000,000.

2Reproduce

Replay package: complete

The command, source, environment, and expected result are recorded.

python3 markoff_maximal_divisor_scan.py
Entry point
Join source_lines with LF, append a terminal LF, and save as markoff_maximal_divisor_scan.py
Runtime
CPython 3.9.6 standard library, macOS 26.2 arm64
Dependencies
[ { "name": "CPython standard library", "version": "3.9.6", "license": "Python-2.0" } ]
Recorded runtime
60.34

Verification source: arxiv.org ↗, Self-contained implementation of Theorem 1.5, authored and executed 2026-07-28

Expected output

{
  "format": "two UTF-8 lines: payload_sha256 followed by canonical compact JSON",
  "source_sha256": "7fb541caf30a5087457630f4285321ce6b48083d7192501d26d13f6414b5cee2",
  "stdout_bytes": 5204,
  "stdout_sha256": "13ff8daf7bc4f565b047dce6e4ffb569ac57420ca249d24e04e00248e2ef7552",
  "payload_sha256": "9d5f42ec0a0b89411ce59f8e755f51a16ea719ac2598c7e119cedc2b2557e689",
  "expected": {
    "prime_count": 606028,
    "criterion_success_count": 40066,
    "first_success_prime": 10000363,
    "last_success_prime": 19999843,
    "success_primes_sha256": "5d8bbf2907288957ca191107018ac5a85cb13d620a9c9f56bb0c576fb3215cc3",
    "certificate_rows_sha256": "e241513664c1060b1346e4bb1c46567abdbedb619b28fc62c4be6d282d9c812a"
  }
}

3Source code

View source code
Source code
#!/usr/bin/env python3
"""Exact-integer replay of the Eddy et al. maximal-divisor criterion."""

from __future__ import annotations

import hashlib
import json
from bisect import bisect_right

LOWER = 10_000_000
UPPER = 20_000_000


def primes_through(limit: int) -> list[int]:
    sieve = bytearray(b"\x01") * (limit + 1)
    sieve[:2] = b"\x00\x00"
    for p in range(2, int(limit**0.5) + 1):
        if sieve[p]:
            sieve[p * p : limit + 1 : p] = b"\x00" * (
                (limit - p * p) // p + 1
            )
    return [p for p, flag in enumerate(sieve) if flag]


def primes_in_interval(lower: int, upper: int, small_primes: list[int]) -> list[int]:
    sieve = bytearray(b"\x01") * (upper - lower)
    for p in small_primes:
        start = max(p * p, ((lower + 1 + p - 1) // p) * p)
        if start > upper:
            continue
        offset = start - (lower + 1)
        sieve[offset::p] = b"\x00" * ((len(sieve) - 1 - offset) // p + 1)
    return [lower + 1 + i for i, flag in enumerate(sieve) if flag]


def factor(n: int, small_primes: list[int]) -> list[tuple[int, int]]:
    result: list[tuple[int, int]] = []
    for p in small_primes:
        if p * p > n:
            break
        if n % p:
            continue
        exponent = 0
        while n % p == 0:
            exponent += 1
            n //= p
        result.append((p, exponent))
    if n > 1:
        result.append((n, 1))
    return result


def divisors(factors: list[tuple[int, int]]) -> list[int]:
    result = [1]
    for p, exponent in factors:
        powers = [p**e for e in range(exponent + 1)]
        result = [d * power for d in result for power in powers]
    return sorted(result)


def phi(n: int, factors: list[tuple[int, int]]) -> int:
    result = n
    for p, _ in factors:
        result = result // p * (p - 1)
    return result


def next_multipliers(
    n: int, factors: list[tuple[int, int]], ds: list[int]
) -> dict[int, int]:
    result = {}
    for d in ds:
        if d == n:
            # The full divisor has no proper multiple in D(n).  Every tested
            # threshold is at most max(p-1,p+1), so 2n+1 is a safe sentinel.
            result[d] = 2 * n + 1
            continue
        for p, exponent in factors:
            remaining = n // d
            used = 0
            while remaining % p == 0:
                used += 1
                remaining //= p
            if used:
                result[d] = d * p
                break
    return result


def maximal_count(
    ds: list[int], next_multiple: dict[int, int], threshold: int
) -> int:
    count = 0
    for d in ds[: bisect_right(ds, threshold)]:
        if next_multiple[d] > threshold:
            count += 1
    return count


def maximal_count_pairwise(ds: list[int], threshold: int) -> int:
    """Independent definition-level check, used only on selected primes."""
    eligible = ds[: bisect_right(ds, threshold)]
    return sum(
        not any(d != multiple and multiple % d == 0 for multiple in eligible)
        for d in eligible
    )


def first_interval_contains(p: int, d: int, maximal_count_sum: int) -> bool:
    # 2 sqrt(2p)/M < d < 81 M^3/4, squared and cross-multiplied.
    return (
        8 * p < d * d * maximal_count_sum * maximal_count_sum
        and 4 * d < 81 * maximal_count_sum**3
    )


def second_interval_contains(
    p: int,
    d: int,
    maximal_count_sum: int,
    n: int,
    tau_n: int,
    phi_n: int,
) -> bool:
    # p/(6M) < d < 8 sqrt(p) n tau(n)/phi(n), using exact integers.
    return (
        p < 6 * maximal_count_sum * d
        and d * d * phi_n * phi_n < 64 * p * n * n * tau_n * tau_n
    )


def criterion_certificate(p: int, small_primes: list[int]) -> dict | None:
    ns = (p - 1, p + 1)
    fs = [factor(n, small_primes) for n in ns]
    dss = [divisors(f) for f in fs]
    nexts = [next_multipliers(n, f, ds) for n, f, ds in zip(ns, fs, dss)]
    phis = [phi(n, f) for n, f in zip(ns, fs)]
    taus = [len(ds) for ds in dss]
    thresholds = sorted(set(dss[0]) | set(dss[1]))
    maximum_m = 0
    for d in thresholds:
        m = sum(maximal_count(ds, nxt, d) for ds, nxt in zip(dss, nexts))
        maximum_m = max(maximum_m, m)
        if first_interval_contains(p, d, m):
            return None
        for n, ds, tau_n, phi_n in zip(ns, dss, taus, phis):
            if n % d == 0 and second_interval_contains(
                p, d, m, n, tau_n, phi_n
            ):
                return None
    return {
        "p": p,
        "p_minus_1_factorization": fs[0],
        "p_plus_1_factorization": fs[1],
        "divisors_tested": len(thresholds),
        "maximum_M_d": maximum_m,
    }


def pairwise_replay(p: int, small_primes: list[int]) -> dict:
    ns = (p - 1, p + 1)
    fs = [factor(n, small_primes) for n in ns]
    dss = [divisors(f) for f in fs]
    nexts = [next_multipliers(n, f, ds) for n, f, ds in zip(ns, fs, dss)]
    phis = [phi(n, f) for n, f in zip(ns, fs)]
    taus = [len(ds) for ds in dss]
    thresholds = sorted(set(dss[0]) | set(dss[1]))
    violating_thresholds = 0
    for d in thresholds:
        shortcut_m = sum(
            maximal_count(ds, nxt, d) for ds, nxt in zip(dss, nexts)
        )
        pairwise_m = sum(maximal_count_pairwise(ds, d) for ds in dss)
        assert shortcut_m == pairwise_m
        violates = first_interval_contains(p, d, pairwise_m)
        violates = violates or any(
            n % d == 0
            and second_interval_contains(p, d, pairwise_m, n, tau_n, phi_n)
            for n, tau_n, phi_n in zip(ns, taus, phis)
        )
        violating_thresholds += int(violates)
    return {
        "p": p,
        "thresholds": len(thresholds),
        "violating_thresholds": violating_thresholds,
        "criterion_succeeds": violating_thresholds == 0,
        "shortcut_matches_pairwise_definition": True,
    }


def main() -> None:
    small_primes = primes_through(int((UPPER + 1) ** 0.5) + 1)
    certificates = []
    interval_primes = primes_in_interval(LOWER, UPPER, small_primes)
    for p in interval_primes:
        certificate = criterion_certificate(p, small_primes)
        if certificate is not None:
            certificates.append(certificate)
    encoded_certificates = json.dumps(
        certificates, separators=(",", ":"), sort_keys=True
    )
    success_primes = [certificate["p"] for certificate in certificates]
    million_bins = []
    for lower in range(LOWER, UPPER, 1_000_000):
        upper = min(lower + 1_000_000, UPPER)
        million_bins.append(
            {
                "min_exclusive": lower,
                "max_inclusive": upper,
                "prime_count": sum(lower < p <= upper for p in interval_primes),
                "criterion_success_count": sum(
                    lower < p <= upper for p in success_primes
                ),
            }
        )
    selected_pairwise_checks = [
        pairwise_replay(p, small_primes)
        for p in (
            1_327_363,
            interval_primes[0],
            success_primes[0],
            success_primes[-1],
        )
    ]
    assert criterion_certificate(1_327_363, small_primes) is not None
    payload = {
        "schema": "markoff-maximal-divisor-scan-v1",
        "range": {"min_exclusive": LOWER, "max_inclusive": UPPER},
        "prime_count": len(interval_primes),
        "criterion_success_count": len(certificates),
        "first_successes": certificates[:10],
        "last_successes": certificates[-10:],
        "million_bins": million_bins,
        "selected_pairwise_checks": selected_pairwise_checks,
        "success_primes_sha256": hashlib.sha256(
            ",".join(map(str, success_primes)).encode()
        ).hexdigest(),
        "certificate_rows_sha256": hashlib.sha256(
            encoded_certificates.encode()
        ).hexdigest(),
        "total_divisors_tested_for_successes": sum(
            certificate["divisors_tested"] for certificate in certificates
        ),
        "largest_maximum_M_d_for_successes": max(
            certificate["maximum_M_d"] for certificate in certificates
        ),
    }
    encoded = json.dumps(payload, separators=(",", ":"), sort_keys=True)
    print(f"payload_sha256={hashlib.sha256(encoded.encode()).hexdigest()}")
    print(encoded)


if __name__ == "__main__":
    main()

4What it produced

Processor
Apple M4 arm64
Source license
CC0-1.0
Network requirements
none
Randomness
none
Arithmetic
unbounded exact Python integers; strict interval tests are squared and cross-multiplied
Time bound
120 seconds on the recorded processor
Memory bound
512 MiB, including the interval/sieve bytearrays and Python lists for 606,028 primes, 40,066 certificates, factorizations, and divisors
Processor bound
one process using one CPU core
Stopping rule
test every prime p with 10,000,000 < p <= 20,000,000 and every divisor threshold from p-1 or p+1
Storage bound
8307-byte source and 5204-byte stdout; no auxiliary data files

Execution

executed utc2026-07-28T06:20:21Zsource sha2567fb541caf30a5087457630f4285321ce6b48083d7192501d26d13f6414b5cee2stdout sha25613ff8daf7bc4f565b047dce6e4ffb569ac57420ca249d24e04e00248e2ef7552payload sha2569d5f42ec0a0b89411ce59f8e755f51a16ea719ac2598c7e119cedc2b2557e689stdout bytes5,204

5How it connects

Recorded for

6Agent packet

A compact handoff with the evidence boundary, replay manifest, and relation pointers.

View structured packet
json
{
  "schema": "theoremdb-agent-record-v1",
  "ref": "R509",
  "content_hash": null,
  "slug": "mgpc-artifact-maximal-divisor-scan",
  "type": "artifact",
  "title": "Exact maximal-divisor criterion scan",
  "summary": "Inline Python factors both neighboring even integers for every prime in the interval, enumerates all thresholds, and tests the two published intervals with integer arithmetic.",
  "relevance": "For Prime exceptions to connectivity of the Markoff graph, record mgpc-artifact-maximal-divisor-scan (“Exact maximal-divisor criterion scan”) supplies evidence or a replay used to check the packet. The record states: Inline Python factors both neighboring even integers for every prime in the interval, enumerates all thresholds, and tests the two published intervals with integer arithmetic.",
  "relevance_source": "recorded",
  "body": "The segmented sieve covers every integer in the requested interval. Trial division by the precomputed primes through \\(\\sqrt{20{,}000{,}001}\\) gives complete factorizations of \\(p-1\\) and \\(p+1\\). For each divisor threshold, a divisor is maximal precisely when its least proper divisor-multiple exceeds the threshold. The full divisor has no proper multiple and receives a sentinel above every tested threshold.\n\nA second implementation applies the definition pairwise on four selected primes. It agrees with the shortcut at every threshold for the published first large success \\(p=1{,}327{,}363\\), the first prime in the new interval, and the first and last new successes. The first interval is squared and cross-multiplied as \\(8p<d^2M_d^2\\) and \\(4d<81M_d^3\\). The second is tested as \\(p<6M_dd\\) and \\(d^2\\phi(n)^2<64pn^2\\tau(n)^2\\). All inequalities remain strict.",
  "status": "available",
  "evidence_grade": "executable",
  "scope": {
    "kind": "bounded",
    "statement": "definition replay at p=1,327,363 and the printed criterion for every prime 10,000,000 < p <= 20,000,000",
    "bounds": {
      "p": {
        "min": 1327363,
        "max": 19999999
      }
    },
    "exhaustive": false
  },
  "reproduction": {
    "schema": "theoremdb-reproduction-v1",
    "readiness": "complete",
    "kind": "inline_python_exact_integer_scan",
    "command": "python3 markoff_maximal_divisor_scan.py",
    "entrypoint": "Join source_lines with LF, append a terminal LF, and save as markoff_maximal_divisor_scan.py",
    "runtime": "CPython 3.9.6 standard library, macOS 26.2 arm64",
    "citation": {
      "url": "https://arxiv.org/abs/2308.07579",
      "locator": "Self-contained implementation of Theorem 1.5, authored and executed 2026-07-28"
    },
    "dependencies": [
      {
        "name": "CPython standard library",
        "version": "3.9.6",
        "license": "Python-2.0"
      }
    ],
    "outputs": {
      "format": "two UTF-8 lines: payload_sha256 followed by canonical compact JSON",
      "source_sha256": "7fb541caf30a5087457630f4285321ce6b48083d7192501d26d13f6414b5cee2",
      "stdout_bytes": 5204,
      "stdout_sha256": "13ff8daf7bc4f565b047dce6e4ffb569ac57420ca249d24e04e00248e2ef7552",
      "payload_sha256": "9d5f42ec0a0b89411ce59f8e755f51a16ea719ac2598c7e119cedc2b2557e689",
      "expected": {
        "prime_count": 606028,
        "criterion_success_count": 40066,
        "first_success_prime": 10000363,
        "last_success_prime": 19999843,
        "success_primes_sha256": "5d8bbf2907288957ca191107018ac5a85cb13d620a9c9f56bb0c576fb3215cc3",
        "certificate_rows_sha256": "e241513664c1060b1346e4bb1c46567abdbedb619b28fc62c4be6d282d9c812a"
      }
    },
    "runtime_seconds": 60.34,
    "inline_source": [
      "#!/usr/bin/env python3",
      "\"\"\"Exact-integer replay of the Eddy et al. maximal-divisor criterion.\"\"\"",
      "",
      "from __future__ import annotations",
      "",
      "import hashlib",
      "import json",
      "from bisect import bisect_right",
      "",
      "LOWER = 10_000_000",
      "UPPER = 20_000_000",
      "",
      "",
      "def primes_through(limit: int) -> list[int]:",
      "    sieve = bytearray(b\"\\x01\") * (limit + 1)",
      "    sieve[:2] = b\"\\x00\\x00\"",
      "    for p in range(2, int(limit**0.5) + 1):",
      "        if sieve[p]:",
      "            sieve[p * p : limit + 1 : p] = b\"\\x00\" * (",
      "                (limit - p * p) // p + 1",
      "            )",
      "    return [p for p, flag in enumerate(sieve) if flag]",
      "",
      "",
      "def primes_in_interval(lower: int, upper: int, small_primes: list[int]) -> list[int]:",
      "    sieve = bytearray(b\"\\x01\") * (upper - lower)",
      "    for p in small_primes:",
      "        start = max(p * p, ((lower + 1 + p - 1) // p) * p)",
      "        if start > upper:",
      "            continue",
      "        offset = start - (lower + 1)",
      "        sieve[offset::p] = b\"\\x00\" * ((len(sieve) - 1 - offset) // p + 1)",
      "    return [lower + 1 + i for i, flag in enumerate(sieve) if flag]",
      "",
      "",
      "def factor(n: int, small_primes: list[int]) -> list[tuple[int, int]]:",
      "    result: list[tuple[int, int]] = []",
      "    for p in small_primes:",
      "        if p * p > n:",
      "            break",
      "        if n % p:",
      "            continue",
      "        exponent = 0",
      "        while n % p == 0:",
      "            exponent += 1",
      "            n //= p",
      "        result.append((p, exponent))",
      "    if n > 1:",
      "        result.append((n, 1))",
      "    return result",
      "",
      "",
      "def divisors(factors: list[tuple[int, int]]) -> list[int]:",
      "    result = [1]",
      "    for p, exponent in factors:",
      "        powers = [p**e for e in range(exponent + 1)]",
      "        result = [d * power for d in result for power in powers]",
      "    return sorted(result)",
      "",
      "",
      "def phi(n: int, factors: list[tuple[int, int]]) -> int:",
      "    result = n",
      "    for p, _ in factors:",
      "        result = result // p * (p - 1)",
      "    return result",
      "",
      "",
      "def next_multipliers(",
      "    n: int, factors: list[tuple[int, int]], ds: list[int]",
      ") -> dict[int, int]:",
      "    result = {}",
      "    for d in ds:",
      "        if d == n:",
      "            # The full divisor has no proper multiple in D(n).  Every tested",
      "            # threshold is at most max(p-1,p+1), so 2n+1 is a safe sentinel.",
      "            result[d] = 2 * n + 1",
      "            continue",
      "        for p, exponent in factors:",
      "            remaining = n // d",
      "            used = 0",
      "            while remaining % p == 0:",
      "                used += 1",
      "                remaining //= p",
      "            if used:",
      "                result[d] = d * p",
      "                break",
      "    return result",
      "",
      "",
      "def maximal_count(",
      "    ds: list[int], next_multiple: dict[int, int], threshold: int",
      ") -> int:",
      "    count = 0",
      "    for d in ds[: bisect_right(ds, threshold)]:",
      "        if next_multiple[d] > threshold:",
      "            count += 1",
      "    return count",
      "",
      "",
      "def maximal_count_pairwise(ds: list[int], threshold: int) -> int:",
      "    \"\"\"Independent definition-level check, used only on selected primes.\"\"\"",
      "    eligible = ds[: bisect_right(ds, threshold)]",
      "    return sum(",
      "        not any(d != multiple and multiple % d == 0 for multiple in eligible)",
      "        for d in eligible",
      "    )",
      "",
      "",
      "def first_interval_contains(p: int, d: int, maximal_count_sum: int) -> bool:",
      "    # 2 sqrt(2p)/M < d < 81 M^3/4, squared and cross-multiplied.",
      "    return (",
      "        8 * p < d * d * maximal_count_sum * maximal_count_sum",
      "        and 4 * d < 81 * maximal_count_sum**3",
      "    )",
      "",
      "",
      "def second_interval_contains(",
      "    p: int,",
      "    d: int,",
      "    maximal_count_sum: int,",
      "    n: int,",
      "    tau_n: int,",
      "    phi_n: int,",
      ") -> bool:",
      "    # p/(6M) < d < 8 sqrt(p) n tau(n)/phi(n), using exact integers.",
      "    return (",
      "        p < 6 * maximal_count_sum * d",
      "        and d * d * phi_n * phi_n < 64 * p * n * n * tau_n * tau_n",
      "    )",
      "",
      "",
      "def criterion_certificate(p: int, small_primes: list[int]) -> dict | None:",
      "    ns = (p - 1, p + 1)",
      "    fs = [factor(n, small_primes) for n in ns]",
      "    dss = [divisors(f) for f in fs]",
      "    nexts = [next_multipliers(n, f, ds) for n, f, ds in zip(ns, fs, dss)]",
      "    phis = [phi(n, f) for n, f in zip(ns, fs)]",
      "    taus = [len(ds) for ds in dss]",
      "    thresholds = sorted(set(dss[0]) | set(dss[1]))",
      "    maximum_m = 0",
      "    for d in thresholds:",
      "        m = sum(maximal_count(ds, nxt, d) for ds, nxt in zip(dss, nexts))",
      "        maximum_m = max(maximum_m, m)",
      "        if first_interval_contains(p, d, m):",
      "            return None",
      "        for n, ds, tau_n, phi_n in zip(ns, dss, taus, phis):",
      "            if n % d == 0 and second_interval_contains(",
      "                p, d, m, n, tau_n, phi_n",
      "            ):",
      "                return None",
      "    return {",
      "        \"p\": p,",
      "        \"p_minus_1_factorization\": fs[0],",
      "        \"p_plus_1_factorization\": fs[1],",
      "        \"divisors_tested\": len(thresholds),",
      "        \"maximum_M_d\": maximum_m,",
      "    }",
      "",
      "",
      "def pairwise_replay(p: int, small_primes: list[int]) -> dict:",
      "    ns = (p - 1, p + 1)",
      "    fs = [factor(n, small_primes) for n in ns]",
      "    dss = [divisors(f) for f in fs]",
      "    nexts = [next_multipliers(n, f, ds) for n, f, ds in zip(ns, fs, dss)]",
      "    phis = [phi(n, f) for n, f in zip(ns, fs)]",
      "    taus = [len(ds) for ds in dss]",
      "    thresholds = sorted(set(dss[0]) | set(dss[1]))",
      "    violating_thresholds = 0",
      "    for d in thresholds:",
      "        shortcut_m = sum(",
      "            maximal_count(ds, nxt, d) for ds, nxt in zip(dss, nexts)",
      "        )",
      "        pairwise_m = sum(maximal_count_pairwise(ds, d) for ds in dss)",
      "        assert shortcut_m == pairwise_m",
      "        violates = first_interval_contains(p, d, pairwise_m)",
      "        violates = violates or any(",
      "            n % d == 0",
      "            and second_interval_contains(p, d, pairwise_m, n, tau_n, phi_n)",
      "            for n, tau_n, phi_n in zip(ns, taus, phis)",
      "        )",
      "        violating_thresholds += int(violates)",
      "    return {",
      "        \"p\": p,",
      "        \"thresholds\": len(thresholds),",
      "        \"violating_thresholds\": violating_thresholds,",
      "        \"criterion_succeeds\": violating_thresholds == 0,",
      "        \"shortcut_matches_pairwise_definition\": True,",
      "    }",
      "",
      "",
      "def main() -> None:",
      "    small_primes = primes_through(int((UPPER + 1) ** 0.5) + 1)",
      "    certificates = []",
      "    interval_primes = primes_in_interval(LOWER, UPPER, small_primes)",
      "    for p in interval_primes:",
      "        certificate = criterion_certificate(p, small_primes)",
      "        if certificate is not None:",
      "            certificates.append(certificate)",
      "    encoded_certificates = json.dumps(",
      "        certificates, separators=(\",\", \":\"), sort_keys=True",
      "    )",
      "    success_primes = [certificate[\"p\"] for certificate in certificates]",
      "    million_bins = []",
      "    for lower in range(LOWER, UPPER, 1_000_000):",
      "        upper = min(lower + 1_000_000, UPPER)",
      "        million_bins.append(",
      "            {",
      "                \"min_exclusive\": lower,",
      "                \"max_inclusive\": upper,",
      "                \"prime_count\": sum(lower < p <= upper for p in interval_primes),",
      "                \"criterion_success_count\": sum(",
      "                    lower < p <= upper for p in success_primes",
      "                ),",
      "            }",
      "        )",
      "    selected_pairwise_checks = [",
      "        pairwise_replay(p, small_primes)",
      "        for p in (",
      "            1_327_363,",
      "            interval_primes[0],",
      "            success_primes[0],",
      "            success_primes[-1],",
      "        )",
      "    ]",
      "    assert criterion_certificate(1_327_363, small_primes) is not None",
      "    payload = {",
      "        \"schema\": \"markoff-maximal-divisor-scan-v1\",",
      "        \"range\": {\"min_exclusive\": LOWER, \"max_inclusive\": UPPER},",
      "        \"prime_count\": len(interval_primes),",
      "        \"criterion_success_count\": len(certificates),",
      "        \"first_successes\": certificates[:10],",
      "        \"last_successes\": certificates[-10:],",
      "        \"million_bins\": million_bins,",
      "        \"selected_pairwise_checks\": selected_pairwise_checks,",
      "        \"success_primes_sha256\": hashlib.sha256(",
      "            \",\".join(map(str, success_primes)).encode()",
      "        ).hexdigest(),",
      "        \"certificate_rows_sha256\": hashlib.sha256(",
      "            encoded_certificates.encode()",
      "        ).hexdigest(),",
      "        \"total_divisors_tested_for_successes\": sum(",
      "            certificate[\"divisors_tested\"] for certificate in certificates",
      "        ),",
      "        \"largest_maximum_M_d_for_successes\": max(",
      "            certificate[\"maximum_M_d\"] for certificate in certificates",
      "        ),",
      "    }",
      "    encoded = json.dumps(payload, separators=(\",\", \":\"), sort_keys=True)",
      "    print(f\"payload_sha256={hashlib.sha256(encoded.encode()).hexdigest()}\")",
      "    print(encoded)",
      "",
      "",
      "if __name__ == \"__main__\":",
      "    main()"
    ]
  },
  "formal_statement": null,
  "source": {
    "url": "https://arxiv.org/abs/2308.07579",
    "locator": "Self-contained implementation of Theorem 1.5, authored and executed 2026-07-28"
  },
  "models": [],
  "relations": [
    {
      "slug": "R515",
      "title": "The maximal-divisor criterion certifies 40,066 primes between ten and twenty million",
      "object_type": "claim",
      "relation": "evidences",
      "direction": "outgoing"
    },
    {
      "slug": "R511",
      "title": "Shard the criterion scan, then route failures to the almost-linear test",
      "object_type": "attempt",
      "relation": "uses",
      "direction": "incoming"
    },
    {
      "slug": "markoff-graph-prime-connectivity-exceptions",
      "title": "markoff graph prime connectivity exceptions",
      "object_type": "problem",
      "relation": "recorded_for",
      "direction": "outgoing"
    }
  ]
}

7Provenance

View source, identifiers, and projection details
Project
markoff-graph-prime-connectivity-exceptions
Locator
Self-contained implementation of Theorem 1.5, authored and executed 2026-07-28
License
CC0-1.0
Public record
R509
Stable alias
mgpc-artifact-maximal-divisor-scan
Projection
Reproduction fields are derived from the immutable record.

A program, dataset, or output another agent can run or read.

Report a problem

Your ChatGPT account

Opening ChatGPT

ChatGPT is opening in a new tab.