The Topswops Machine

John Conway's one-rule card game: read the top card, flip over that many. Repeat until the ace surfaces. Trivial to state. The machine counts how long games take and which decks last longest. The decks no flip can produce have a signature you can read without playing: no card below the top is in its own place.

Companion film — 2:30 The longest 7-card game played card by card (the deck [4,7,6,2,1,5,3] lasts 16 flips — the most any 7-card deck can, A000375), then all 5,040 deals tallied, the Garden-of-Eden count (= A000255(6)), and the three sequences laid side by side. Every figure on screen is computed live from the same engine the page runs; the melody is that longest game, played note-per-flip. Recomputed by research/topswops/verify.mjs (9/9).
Film clarification: The film calls A000255 “Euler’s fixed-point-free count”. Euler’s interpretation counts only fixed-point-free permutations beginning with 2 (OEIS A000255). The video retains the shorter wording.

Deal, then flip

Press Shuffle to deal a deck.

The rule: if the top card is k, reverse the order of the top k cards. If it is 1 (the ace), stop. Conway proved this always stops.

What just happened, counted

For a deck of 7 cards there are 5040 possible deals. For 2 to 9 cards the machine plays every deal in your browser; at 10 cards it uses stored counts.

Flip-count distribution over all deals (height = frequency; rightmost bar = the longest-lasting decks). Very small counts get a minimum visible height:

0 flipsmax

The decks no flip can produce

Every flip lands the machine on some new deck. Run it backwards: are there deals that are never the result of a flip — that can only ever be a starting hand? There are. They have a clean signature.

A deck is the result of a flip exactly when some card k sits in position k below the top (reverse the first k and it lands there). So the unreachable decks are precisely the permutations with no card in its own place except possibly the top. Counting those gives a sequence the catalogue already knows by another name — A000255, Euler's count of fixed-point-free permutations beginning with 2. A new bridge between a card game and an 18th-century permutation count.

Three sequences fall out

Tabulate those counts as n grows and you get integer sequences. Two are already catalogued. One — the total number of flips across all deals — was not in the OEIS when this page was built (checked 2026-06-24), so it is staged as a new entry with its working shown.

Verified exactly (BigInt / exhaustive). New column in gold.
nmax flips
A000375
longest-lasting
decks A123398
total flips
(new)
unreachable
A000255(n-1)

The same code reproduces the catalogued columns (max flips, longest-lasting decks). That calibrates the engine; it does not independently establish the total-flips column. Run node research/topswops/verify.mjs (9/9) for the engine checks, including total flips for n = 1..11. The separate staged-total check recomputes n = 1..9 with two implementations and n = 10..11 with one; for n = 12..13 it compares stored values. See the per-term coverage and recorded same-engine reruns.

The check

For the selected size from 2 to 9 cards, the statistics are recomputed in your browser by exhaustively playing all n! deals and compared with stored values. Ten-card statistics and the table through 13 cards are precomputed.

Calibration: for the selected size n = 2..9, live enumeration reproduces OEIS A000375 (maximum flips) and A123398 (number of maximizing decks). A000375 lists 0, 1, 2, 4, 7, 10, 16, 22, 30, 38, 51, 65, 80 for n = 1..13; the table's larger values are precomputed. Only the total-flips column is claimed new.

The new sequence: total flips over all deals = 0, 1, 6, 38, 265, 2115, 18508, 180260, 1911505, 22169434, 277931375, 3758940272, 54349566758 (n = 1..13), confirmed absent from the OEIS at build time. The bridge: unreachable decks = A000255(n−1), by the fixed-point characterization above and inclusion-exclusion. research/topswops/verify.mjs makes three finite cross-checks: preimage counts for n = 1..8; direct counts, inclusion-exclusion and A000255's recurrence for n = 1..9; and the flip-image predicate for n = 2..7.

Honest apparatus. Conway's termination theorem is cited, not re-proved here. The mean number of flips appears to grow roughly linearly in n, but no asymptotic is claimed — only the exact totals shown. "Absent from OEIS" is a dated catalogue claim, not a theorem of non-existence. Deposited on Zenodo (issued 2026-08-15). The separate OEIS route calls for independent human authorship under its AI-submission policy; not auto-submitted.

Corrections

Corrected 2026-10-14: The introduction said that identifying decks no flip can produce required running the game. A deck is unreachable exactly when no card below the top is in its own numbered position; inspecting those positions suffices (found by the assay line, 2026-10-14).

Corrected 2026-10-14: The histogram caption said the tallest bar marked the longest-lasting decks. Height represents the number of decks at each flip count; the rightmost bar marks the longest games (found by the assay line, 2026-10-14).

Updated 2026-10-14: The page said the sequence was staged for Zenodo. DataCite now records DOI 10.5281/zenodo.21943934 as issued on 2026-08-15 (found by the assay line, 2026-10-14).

The claims record 89 claims re-read against their sources, 14 October 2026

Written 2026-06-24. Claims re-read against their sources on 2026-10-14: 89 checked, 74 confirmed, 13 wrong, 0 unverifiable, 2 true when written and overtaken since (dated, not corrected). By the assay line (research/assay-line/queue-1014c/), Codex fixer directed by claude-assaying-boyle-1014; source record by Codex, checked by Codex; repaired by Codex from this batch's fixcheck.md.

This was the directed correction pass for topswops-machine at read 6707fd4e2e, following all 15 queue-1014c triage items after re-reading their evidence. It records 2 WRONG, 11 MINOR (counted in wrong), and 2 STALE findings, and carries forward the checker's 74 CONFIRMED claims with their original f5e5f84f34 provenance explicitly labelled; those earlier measurements are not represented as new runs. The page, markdown and film text source were corrected within this layer only. The existing MP4 remains unchanged under the task's no-render instruction, and that incomplete part of X9 is recorded below.

This record is long (89 claim lines and 15 findings), so it is not part of the page until you open it. It loads here now if your browser runs scripts; otherwise, or to keep it, read the whole record as plain text.

The assay office: what a record is, and every layer re-read so far.