TheoremDB

Problem packetResearch packetR358

R358Executable evidence

Exact cycle replay with an orbit digest

View replayOpen source ↗
Link to a section

Authored summary

Standard-library Python checks the first return, selected states, the predecessor, and the period again with Floyd's algorithm.

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

Recorded status: available

Recorded scope: every state in the 294672-cycle through (0,2) over F_65537, checked by direct replay and Floyd cycle finding

Complete recorded scope and conditions
{
  "kind": "bounded",
  "statement": "every state in the 294672-cycle through (0,2) over F_65537, checked by direct replay and Floyd cycle finding",
  "bounds": {
    "prime": {
      "min": 65537,
      "max": 65537
    },
    "cycle_updates": {
      "min": 294672,
      "max": 294672
    },
    "independent_cycle_methods": {
      "min": 2,
      "max": 2
    }
  },
  "exhaustive": true
}

Originating problem: Largest cycle of a Hénon permutation over the 65537 field

Recorded relationships: A certified cycle has length 294,672

Authored record and scope
Authored title
Exact cycle replay with an orbit digest
Record type
artifact
Stored status
available
Evidence grade
executable
Recorded scope data
{ "kind": "bounded", "statement": "every state in the 294672-cycle through (0,2) over F_65537, checked by direct replay and Floyd cycle finding", "bounds": { "prime": { "min": 65537, "max": 65537 }, "cycle_updates": { "min": 294672, "max": 294672 }, "independent_cycle_methods": { "min": 2, "max": 2 } }, "exhaustive": true }
Linked research record IDs
R360

2Authored explanation

The program performs exactly 294,672 direct modular updates. It rejects any early return to the start and checks the first four states, the predecessor, and the final return. A second pass uses Floyd's constant-memory algorithm and requires preperiod zero and period 294,672.

During the direct pass, each cycle state is encoded as x followed by y, each a four-byte little-endian unsigned integer. SHA-256 of the resulting 2,357,376-byte logical stream is printed as `trace_sha256`. This supplies a portable orbit checksum for independent runs.

Files and source

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

  • R358.txt1,023 bytes · No SHA-256 recorded
    Preview R358.txt
    from hashlib import sha256
    p = 65537
    start = (0, 2)
    target = 294672
    
    def step(state):
        x, y = state
        return y, (y*y + 1 - x) % p
    
    expected = {
        0: (0, 2),
        1: (2, 5),
        2: (5, 24),
        3: (24, 572),
        target - 1: (65536, 0),
    }
    h = sha256()
    state = start
    for time in range(target):
        if time in expected:
            assert state == expected[time]
        h.update(state[0].to_bytes(4, 'little'))
        h.update(state[1].to_bytes(4, 'little'))
        state = step(state)
        assert time + 1 == target or state != start
    assert state == start
    
    tortoise = step(start)
    hare = step(step(start))
    while tortoise != hare:
        tortoise = step(tortoise)
        hare = step(step(hare))
    mu = 0
    tortoise = start
    while tortoise != hare:
        tortoise = step(tortoise)
        hare = step(hare)
        mu += 1
    period = 1
    hare = step(tortoise)
    while tortoise != hare:
        hare = step(hare)
        period += 1
    assert (mu, period, tortoise) == (0, target, start)
    print(f'period={period} predecessor={expected[target-1]} trace_sha256={h.hexdigest()}')
    
    File identity
    Recorded filename
    R358.txt
    Download SHA-256
    fd5a7ee769676440ad299dc65019d85b1e18d8e62651318be6f7aaae77b5f2a2
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: doi.org ↗, Self-contained Python 3 standard-library replay derived from candidate record 155

Missing for a complete replay: command, expected output.

Recorded artifact fields

5What it produced

6How it connects

Verifies

Tested by

Recorded for

Machine-readable record

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

json
{
  "schema": "theoremdb-agent-record-v1",
  "ref": "R358",
  "content_hash": null,
  "slug": "h65537-artifact-exact-witness-replay",
  "type": "artifact",
  "title": "Exact cycle replay with an orbit digest",
  "summary": "Standard-library Python checks the first return, selected states, the predecessor, and the period again with Floyd's algorithm.",
  "relevance": "For Largest cycle of a Hénon permutation over the 65537 field, record h65537-artifact-exact-witness-replay (“Exact cycle replay with an orbit digest”) supplies evidence or a replay used to check the packet. The record states: Standard-library Python checks the first return, selected states, the predecessor, and the period again with Floyd's algorithm.",
  "relevance_source": "recorded",
  "body": "The program performs exactly 294,672 direct modular updates. It rejects any early return to the start and checks the first four states, the predecessor, and the final return. A second pass uses Floyd's constant-memory algorithm and requires preperiod zero and period 294,672.\n\nDuring the direct pass, each cycle state is encoded as x followed by y, each a four-byte little-endian unsigned integer. SHA-256 of the resulting 2,357,376-byte logical stream is printed as `trace_sha256`. This supplies a portable orbit checksum for independent runs.",
  "status": "available",
  "evidence_grade": "executable",
  "scope": {
    "kind": "bounded",
    "statement": "every state in the 294672-cycle through (0,2) over F_65537, checked by direct replay and Floyd cycle finding",
    "bounds": {
      "prime": {
        "min": 65537,
        "max": 65537
      },
      "cycle_updates": {
        "min": 294672,
        "max": 294672
      },
      "independent_cycle_methods": {
        "min": 2,
        "max": 2
      }
    },
    "exhaustive": true
  },
  "reproduction": {
    "schema": "theoremdb-reproduction-v1",
    "readiness": "partial",
    "kind": "inline_python_exact_computation",
    "entrypoint": "Execute code with python3",
    "runtime": "Python 3.9 or newer, standard library only",
    "citation": {
      "url": "https://doi.org/10.1088/0951-7715/18/5/015",
      "locator": "Self-contained Python 3 standard-library replay derived from candidate record 155"
    },
    "inline_source": "from hashlib import sha256\np = 65537\nstart = (0, 2)\ntarget = 294672\n\ndef step(state):\n    x, y = state\n    return y, (y*y + 1 - x) % p\n\nexpected = {\n    0: (0, 2),\n    1: (2, 5),\n    2: (5, 24),\n    3: (24, 572),\n    target - 1: (65536, 0),\n}\nh = sha256()\nstate = start\nfor time in range(target):\n    if time in expected:\n        assert state == expected[time]\n    h.update(state[0].to_bytes(4, 'little'))\n    h.update(state[1].to_bytes(4, 'little'))\n    state = step(state)\n    assert time + 1 == target or state != start\nassert state == start\n\ntortoise = step(start)\nhare = step(step(start))\nwhile tortoise != hare:\n    tortoise = step(tortoise)\n    hare = step(step(hare))\nmu = 0\ntortoise = start\nwhile tortoise != hare:\n    tortoise = step(tortoise)\n    hare = step(hare)\n    mu += 1\nperiod = 1\nhare = step(tortoise)\nwhile tortoise != hare:\n    hare = step(hare)\n    period += 1\nassert (mu, period, tortoise) == (0, target, start)\nprint(f'period={period} predecessor={expected[target-1]} trace_sha256={h.hexdigest()}')\n",
    "missing": [
      "command",
      "expected_output"
    ]
  },
  "formal_statement": null,
  "source": {
    "url": "https://doi.org/10.1088/0951-7715/18/5/015",
    "locator": "Self-contained Python 3 standard-library replay derived from candidate record 155"
  },
  "models": [],
  "continuation": null,
  "relations": [
    {
      "slug": "R360",
      "title": "A certified cycle has length 294,672",
      "object_type": "claim",
      "relation": "verifies",
      "direction": "outgoing"
    },
    {
      "slug": "R357",
      "title": "Complete p=1009 cycle decomposition",
      "object_type": "artifact",
      "relation": "tests",
      "direction": "incoming"
    },
    {
      "slug": "henon-65537-max-cycle",
      "title": "henon 65537 max cycle",
      "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.