TheoremDB
R429artifactStatus: availableEvidence: ReproducedReplay: partialexhaustive over its scope

[#R429] Complete small-prime cycle decompositions

View replayOpen source ↗

1Summary

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

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`.

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

2Reproduce

Replay: partial

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

Entry point
Execute code with python3
Runtime
CPython 3.9 or newer, standard library only

Verification source: doi.org ↗, Self-contained Python 3 standard-library computation reproduced on 2026-07-25

Missing for a complete replay: command, expected output.

3Source code

View source code
Source code
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)

4What it produced

P101

states10,201cycles101maximum period486

P1009

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

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": "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"
  },
  "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"
    }
  ]
}

7Provenance

View source, identifiers, and projection details
Project
kicked-map-million-prime-cycle
Locator
Self-contained Python 3 standard-library computation reproduced on 2026-07-25
License
CC0-1.0
Contributors
TheoremDB entry research, 2026-07-25
Public record
R429
Stable alias
kmmp-artifact-small-prime-decompositions
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.