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.
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:
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.
| n | max 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).