TheoremDB

Problem packetResearch packetR429

R429Executable evidence

Complete small-prime cycle decompositions

View replayOpen source ↗
Link to a section

Authored summary

Independent Python enumeration reproduces maximum periods 486 at p=101 and 6,724 at p=1009.

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

Recorded status: available

Recorded scope: the complete state spaces for the same map at p=101 and p=1009

Complete recorded scope and conditions
{
  "kind": "bounded",
  "statement": "the complete state spaces for the same map at p=101 and p=1009",
  "bounds": {
    "prime": {
      "min": 101,
      "max": 1009
    },
    "complete_decompositions": {
      "min": 2,
      "max": 2
    }
  },
  "exhaustive": true
}

Originating problem: Longest cycle of a nonlinear area-preserving map over F_1000003

Authored record and scope
Authored title
Complete small-prime cycle decompositions
Record type
artifact
Stored status
available
Evidence grade
executable
Recorded scope data
{ "kind": "bounded", "statement": "the complete state spaces for the same map at p=101 and p=1009", "bounds": { "prime": { "min": 101, "max": 1009 }, "complete_decompositions": { "min": 2, "max": 2 } }, "exhaustive": true }

2Authored explanation

A visited bitmap decomposes every state into disjoint cycles. At \(p=101\), the map has 101 cycles and maximum period 486, first encountered at \((0,9)\). At \(p=1009\), it has 1,011 cycles and maximum period 6,724, first encountered at \((0,134)\). These reproduce both calibration values in the candidate record.

For each prime, the program hashes the sorted `period:multiplicity` histogram with SHA-256. The digests are `c9ced7c56ae551bbc25d3be50b00610336cef8b561c9ffb5ff00a0ba57e2aeb6` and `404eaecab6ff5302910b9986568d2362856415376fcb3b49c4b30efe972f50f3`.

Files and source

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

  • R429.txt1,035 bytes · No SHA-256 recorded
    Preview R429.txt
    from collections import Counter
    from hashlib import sha256
    expected = {
        101: (486, (0, 9), 101, 'c9ced7c56ae551bbc25d3be50b00610336cef8b561c9ffb5ff00a0ba57e2aeb6'),
        1009: (6724, (0, 134), 1011, '404eaecab6ff5302910b9986568d2362856415376fcb3b49c4b30efe972f50f3'),
    }
    for p, target in expected.items():
        seen = bytearray(p * p)
        hist = Counter()
        best = 0
        witness = None
        for state in range(p * p):
            if seen[state]:
                continue
            x, y = divmod(state, p)
            x0, y0 = x, y
            period = 0
            while True:
                seen[x * p + y] = 1
                period += 1
                yy = (y + x * x) % p
                x, y = (x + yy) % p, yy
                if (x, y) == (x0, y0):
                    break
            hist[period] += 1
            if period > best:
                best, witness = period, (x0, y0)
        payload = ''.join(f'{k}:{hist[k]}\n' for k in sorted(hist)).encode()
        result = best, witness, sum(hist.values()), sha256(payload).hexdigest()
        assert result == target
        print(p, result)
    
    File identity
    Recorded filename
    R429.txt
    Download SHA-256
    7e539a97e92ffbf97919cb10d7d5482af71471df7f4e0c4f5740a9d8403dd61c
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 computation reproduced on 2026-07-25

Missing for a complete replay: command, expected output.

Recorded artifact fields

5What it produced

P101

states10,201cycles101maximum period486

P1009

states1,018,081cycles1,011maximum period6,724

6How it connects

Recorded for

Machine-readable record

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

json
{
  "schema": "theoremdb-agent-record-v1",
  "ref": "R429",
  "content_hash": null,
  "slug": "kmmp-artifact-small-prime-decompositions",
  "type": "artifact",
  "title": "Complete small-prime cycle decompositions",
  "summary": "Independent Python enumeration reproduces maximum periods 486 at p=101 and 6,724 at p=1009.",
  "relevance": "For Longest cycle of a nonlinear area-preserving map over F_1000003, record kmmp-artifact-small-prime-decompositions (“Complete small-prime cycle decompositions”) supplies evidence or a replay used to check the packet. The record states: Independent Python enumeration reproduces maximum periods 486 at p=101 and 6,724 at p=1009.",
  "relevance_source": "recorded",
  "body": "A visited bitmap decomposes every state into disjoint cycles. At \\(p=101\\), the map has 101 cycles and maximum period 486, first encountered at \\((0,9)\\). At \\(p=1009\\), it has 1,011 cycles and maximum period 6,724, first encountered at \\((0,134)\\). These reproduce both calibration values in the candidate record.\n\nFor each prime, the program hashes the sorted `period:multiplicity` histogram with SHA-256. The digests are `c9ced7c56ae551bbc25d3be50b00610336cef8b561c9ffb5ff00a0ba57e2aeb6` and `404eaecab6ff5302910b9986568d2362856415376fcb3b49c4b30efe972f50f3`.",
  "status": "available",
  "evidence_grade": "executable",
  "scope": {
    "kind": "bounded",
    "statement": "the complete state spaces for the same map at p=101 and p=1009",
    "bounds": {
      "prime": {
        "min": 101,
        "max": 1009
      },
      "complete_decompositions": {
        "min": 2,
        "max": 2
      }
    },
    "exhaustive": true
  },
  "reproduction": {
    "schema": "theoremdb-reproduction-v1",
    "readiness": "partial",
    "kind": "inline_python_exact_computation",
    "entrypoint": "Execute code with python3",
    "runtime": "CPython 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 computation reproduced on 2026-07-25"
    },
    "inline_source": "from collections import Counter\nfrom hashlib import sha256\nexpected = {\n    101: (486, (0, 9), 101, 'c9ced7c56ae551bbc25d3be50b00610336cef8b561c9ffb5ff00a0ba57e2aeb6'),\n    1009: (6724, (0, 134), 1011, '404eaecab6ff5302910b9986568d2362856415376fcb3b49c4b30efe972f50f3'),\n}\nfor p, target in expected.items():\n    seen = bytearray(p * p)\n    hist = Counter()\n    best = 0\n    witness = None\n    for state in range(p * p):\n        if seen[state]:\n            continue\n        x, y = divmod(state, p)\n        x0, y0 = x, y\n        period = 0\n        while True:\n            seen[x * p + y] = 1\n            period += 1\n            yy = (y + x * x) % p\n            x, y = (x + yy) % p, yy\n            if (x, y) == (x0, y0):\n                break\n        hist[period] += 1\n        if period > best:\n            best, witness = period, (x0, y0)\n    payload = ''.join(f'{k}:{hist[k]}\\n' for k in sorted(hist)).encode()\n    result = best, witness, sum(hist.values()), sha256(payload).hexdigest()\n    assert result == target\n    print(p, result)\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 computation reproduced on 2026-07-25"
  },
  "models": [],
  "continuation": null,
  "relations": [
    {
      "slug": "R428",
      "title": "Exact 4,096-start search and record-cycle replay",
      "object_type": "artifact",
      "relation": "tests",
      "direction": "outgoing"
    },
    {
      "slug": "kicked-map-million-prime-cycle",
      "title": "kicked map million prime 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.