TheoremDB

Problem packetResearch packetR718

R718Executable evidence

Two-generator certificate for 100,000 P-positions

View replayOpen source ↗
Link to a section

Authored summary

A forbidden-gap mex generator and a direct pair-attack generator agree on the complete prefix.

Executable material is recorded. Successful replay is a separate check.

Recorded status: available

Recorded scope: all of the first 100,000 P-positions and their gaps

Complete recorded scope and conditions
{
  "kind": "bounded",
  "statement": "all of the first 100,000 P-positions and their gaps",
  "bounds": {
    "position_ordinal": {
      "min": 1,
      "max": 100000
    }
  },
  "exhaustive": true
}

Originating problem: A gap of 50 in square-diagonal Wythoff Nim

Recorded relationships: The first gap 50 occurs at P-position 42,762

Authored record and scope
Authored title
Two-generator certificate for 100,000 P-positions
Record type
artifact
Stored status
available
Evidence grade
executable
Recorded scope data
{ "kind": "bounded", "statement": "all of the first 100,000 P-positions and their gaps", "bounds": { "position_ordinal": { "min": 1, "max": 100000 } }, "exhaustive": true }
Linked research record IDs
R720

2Authored explanation

The optimized generator observes that a diagonal move preserves \(b-a\). For each new mex coordinate \(a\), it checks every square \(s^2\leq a\), reads the gap of the earlier pair whose first coordinate is \(a-s^2\), and forbids that gap. The independent generator stores complete prior pairs and tests each candidate \((a,b)\) directly against every shifted pair \((a-s^2,b-s^2)\). Both also exclude previously used coordinates.

The generators return identical lists of 100,000 pairs. Serializing that list as compact JSON with no spaces or trailing newline gives 1,486,349 bytes and SHA-256 digest ``` f5cacfeedfe15d229189db324a2a8457c4b765007c9f575184549578be15d55b ``` The compact 68-row record-gap table has SHA-256 digest `6a8a5adb0eb6794be663251ab7babce82198d8f95eb81466c45ecb59d094101a`.

Files and source

Files embedded in this record. Matching a file hash confirms its identity.

  • R718.txt2,069 bytes · No SHA-256 recorded
    Preview R718.txt
    from hashlib import sha256
    from json import dumps
    LIMIT=100000
    CAP=250000
    PATH_HASH='f5cacfeedfe15d229189db324a2a8457c4b765007c9f575184549578be15d55b'
    RECORD_HASH='6a8a5adb0eb6794be663251ab7babce82198d8f95eb81466c45ecb59d094101a'
    def optimized():
        used=bytearray(CAP)
        first_gap=[-1]*CAP
        path=[]; mex=0; squares=[]; root=1
        for _ in range(LIMIT):
            while used[mex]: mex+=1
            a=mex
            while root*root<=a:
                squares.append(root*root); root+=1
            forbidden=set()
            for square in squares:
                gap=first_gap[a-square]
                if gap>=0: forbidden.add(gap)
            b=a
            while used[b] or b-a in forbidden: b+=1
            path.append((a,b))
            first_gap[a]=b-a
            used[a]=used[b]=1
        return path
    def direct():
        used=bytearray(CAP)
        prior=set()
        path=[]; mex=0; squares=[]; root=1
        for _ in range(LIMIT):
            while used[mex]: mex+=1
            a=mex
            while root*root<=a:
                squares.append(root*root); root+=1
            b=a
            while True:
                if not used[b] and all((a-square,b-square) not in prior for square in squares): break
                b+=1
            pair=(a,b)
            path.append(pair); prior.add(pair)
            used[a]=used[b]=1
        return path
    path=optimized()
    assert path==direct()
    records=[]; best=-1
    for ordinal,(a,b) in enumerate(path,1):
        gap=b-a
        if gap>best:
            best=gap; records.append([ordinal,a,b,gap])
    qualified=[(i+1,a,b,b-a) for i,(a,b) in enumerate(path) if b-a>=50]
    maxima=[(i+1,a,b) for i,(a,b) in enumerate(path) if b-a==67]
    raw=dumps(path,separators=(',',':')).encode()
    record_raw=dumps(records,separators=(',',':')).encode()
    assert len(raw)==1486349 and sha256(raw).hexdigest()==PATH_HASH
    assert len(record_raw)==1438 and sha256(record_raw).hexdigest()==RECORD_HASH
    assert qualified[0]==(42762,83742,83792,50) and len(qualified)==8421
    assert records[-1]==[96868,190625,190692,67] and len(maxima)==3
    assert path[-1]==(196828,196850) and max(map(max,path))==196880
    print(len(path),qualified[0],records[-1],path[-1],PATH_HASH)
    File identity
    Recorded filename
    R718.txt
    Download SHA-256
    1d97d8bd4f8b44c7152a32a7c95508a079d4063724ed4588c7ff5d224152be67
Continue this work
Replay material: partial

4Reproduce

Replay package: partial

Part of the replay path is recorded. Check the missing fields before comparing a new run.

Verification source: ajc.maths.uq.edu.au ↗, Self-contained CPython computation independently executed on 2026-07-24

Missing for a complete replay: command, expected output.

Recorded artifact fields

5What it produced

6How it connects

Evidence for

Recorded for

Machine-readable record

Copy the structured record when continuing this work with an agent.

json
{
  "schema": "theoremdb-agent-record-v1",
  "ref": "R718",
  "content_hash": null,
  "slug": "sdw-artifact-two-generator-certificate",
  "type": "artifact",
  "title": "Two-generator certificate for 100,000 P-positions",
  "summary": "A forbidden-gap mex generator and a direct pair-attack generator agree on the complete prefix.",
  "relevance": "This supplies a computation, dataset, or executable check used to assess the target problem.",
  "relevance_source": "derived",
  "body": "The optimized generator observes that a diagonal move preserves \\(b-a\\). For each new mex coordinate \\(a\\), it checks every square \\(s^2\\leq a\\), reads the gap of the earlier pair whose first coordinate is \\(a-s^2\\), and forbids that gap. The independent generator stores complete prior pairs and tests each candidate \\((a,b)\\) directly against every shifted pair \\((a-s^2,b-s^2)\\). Both also exclude previously used coordinates.\n\nThe generators return identical lists of 100,000 pairs. Serializing that list as compact JSON with no spaces or trailing newline gives 1,486,349 bytes and SHA-256 digest\n```\nf5cacfeedfe15d229189db324a2a8457c4b765007c9f575184549578be15d55b\n```\nThe compact 68-row record-gap table has SHA-256 digest `6a8a5adb0eb6794be663251ab7babce82198d8f95eb81466c45ecb59d094101a`.",
  "status": "available",
  "evidence_grade": "executable",
  "scope": {
    "kind": "bounded",
    "statement": "all of the first 100,000 P-positions and their gaps",
    "bounds": {
      "position_ordinal": {
        "min": 1,
        "max": 100000
      }
    },
    "exhaustive": true
  },
  "reproduction": {
    "schema": "theoremdb-reproduction-v1",
    "readiness": "partial",
    "kind": "inline_python_computation",
    "entrypoint": "join source_lines with newline and run with python3",
    "runtime": "CPython 3, standard library only; about 35 seconds on the recorded run",
    "citation": {
      "url": "https://ajc.maths.uq.edu.au/pdf/44/ajc_v44_p043.pdf",
      "locator": "Self-contained CPython computation independently executed on 2026-07-24"
    },
    "inline_source": [
      "from hashlib import sha256",
      "from json import dumps",
      "LIMIT=100000",
      "CAP=250000",
      "PATH_HASH='f5cacfeedfe15d229189db324a2a8457c4b765007c9f575184549578be15d55b'",
      "RECORD_HASH='6a8a5adb0eb6794be663251ab7babce82198d8f95eb81466c45ecb59d094101a'",
      "def optimized():",
      "    used=bytearray(CAP)",
      "    first_gap=[-1]*CAP",
      "    path=[]; mex=0; squares=[]; root=1",
      "    for _ in range(LIMIT):",
      "        while used[mex]: mex+=1",
      "        a=mex",
      "        while root*root<=a:",
      "            squares.append(root*root); root+=1",
      "        forbidden=set()",
      "        for square in squares:",
      "            gap=first_gap[a-square]",
      "            if gap>=0: forbidden.add(gap)",
      "        b=a",
      "        while used[b] or b-a in forbidden: b+=1",
      "        path.append((a,b))",
      "        first_gap[a]=b-a",
      "        used[a]=used[b]=1",
      "    return path",
      "def direct():",
      "    used=bytearray(CAP)",
      "    prior=set()",
      "    path=[]; mex=0; squares=[]; root=1",
      "    for _ in range(LIMIT):",
      "        while used[mex]: mex+=1",
      "        a=mex",
      "        while root*root<=a:",
      "            squares.append(root*root); root+=1",
      "        b=a",
      "        while True:",
      "            if not used[b] and all((a-square,b-square) not in prior for square in squares): break",
      "            b+=1",
      "        pair=(a,b)",
      "        path.append(pair); prior.add(pair)",
      "        used[a]=used[b]=1",
      "    return path",
      "path=optimized()",
      "assert path==direct()",
      "records=[]; best=-1",
      "for ordinal,(a,b) in enumerate(path,1):",
      "    gap=b-a",
      "    if gap>best:",
      "        best=gap; records.append([ordinal,a,b,gap])",
      "qualified=[(i+1,a,b,b-a) for i,(a,b) in enumerate(path) if b-a>=50]",
      "maxima=[(i+1,a,b) for i,(a,b) in enumerate(path) if b-a==67]",
      "raw=dumps(path,separators=(',',':')).encode()",
      "record_raw=dumps(records,separators=(',',':')).encode()",
      "assert len(raw)==1486349 and sha256(raw).hexdigest()==PATH_HASH",
      "assert len(record_raw)==1438 and sha256(record_raw).hexdigest()==RECORD_HASH",
      "assert qualified[0]==(42762,83742,83792,50) and len(qualified)==8421",
      "assert records[-1]==[96868,190625,190692,67] and len(maxima)==3",
      "assert path[-1]==(196828,196850) and max(map(max,path))==196880",
      "print(len(path),qualified[0],records[-1],path[-1],PATH_HASH)"
    ],
    "missing": [
      "command",
      "expected_output"
    ]
  },
  "formal_statement": null,
  "source": {
    "url": "https://ajc.maths.uq.edu.au/pdf/44/ajc_v44_p043.pdf",
    "locator": "Self-contained CPython computation independently executed on 2026-07-24"
  },
  "models": [],
  "continuation": null,
  "relations": [
    {
      "slug": "R720",
      "title": "The first gap 50 occurs at P-position 42,762",
      "object_type": "claim",
      "relation": "evidences",
      "direction": "outgoing"
    },
    {
      "slug": "R721",
      "title": "The mex construction generates exactly the P-positions",
      "object_type": "claim",
      "relation": "tests",
      "direction": "outgoing"
    },
    {
      "slug": "square-diagonal-wythoff-gap-50",
      "title": "square diagonal wythoff gap 50",
      "object_type": "problem",
      "relation": "recorded_for",
      "direction": "outgoing"
    }
  ]
}

8Provenance

View source, identifiers, and projection details

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

Sign in to follow

Sign in in another tab, then return here.

Open sign-in in another tab

Report a problem

Report location:

Your ChatGPT account

Opening ChatGPT

ChatGPT is opening in a new tab.