Yamagishi Complexity Torus LabYamagishi Lab

[Paper 846] Whether You Can Win Is Settled by Painting Backwards; How Many Moves It Takes Is Not in That Label

Abstract

Solving a game is imagined as reading forwards from the opening. This paper counts that painting from the end is cheaper, and that something is still missing. No new theorem or law is claimed.

First, painting backwards settles every position: looking at each of $0$ to $1000$ once gives $286$ losing positions (Section 2).

Second, they fall into a pattern: exactly those congruent to $0$ or $2$ modulo $7$, with no disagreement in either direction (Section 2).

Third, the pattern cannot be read off the allowed moves: the moves are $1$, $3$ and $4$, and the period is $7$ (Section 2).

Fourth, and this is the core. The label “win” carries no count of moves: within it the number of moves takes $286$ distinct values, from $1$ to $571$ (Section 3).

Fifth, searching forwards revisits the same positions: at position $25$, $229970$ positions forwards against $26$ backwards, a ratio of $\mathbf{8845.000000}$ (Section 4).

Sixth, the separator is whether one asks whether you can win or in how many moves: the second must be carried while painting, or it cannot be recovered afterwards (Section 5).

Keywords: retrograde analysis, subtraction game, losing position, period, move count, exhaustive enumeration.

Scope (what is not claimed)

No new theorem or law is claimed: settling positions by working back from the end (retrograde analysis), the periodicity of losing positions in a one-heap subtraction game, and the Sprague--Grundy theory, are all known. Real games are not discussed: strength at chess or go, and actual play, are not entered. The periodicity is not proved: that the period is $7$ is confirmed by enumeration, not proved; the Sprague--Grundy theory is only named. The move set is not generalised: only $1$, $3$, $4$ is examined; other sets are not treated. Both players are taken to play best: misreadings and time limits are not treated. The size is not generalised: positions above $1000$ were not counted. Relation to earlier papers: Paper 602 showed that who wins at Nim is decided by addition without carries. This paper does not sit in that seat but stands beside it: there several heaps and a closed formula, here one heap with no formula and nothing to do but paint. Paper 300 showed that whether two things share a root is decidable: the win-or-lose label and the number of moves are distinct roots by that criterion. What is added is painting to $1000$ and confirming the congruence in both directions, counting $286$ distinct move counts inside one label, measuring the ratio between forward and backward position counts, and placing the separator on whether versus how many.

1. Notation and the Question

Setting: there are $n$ stones. Two players alternately take $1$, $3$ or $4$; whoever cannot move loses.

$$\mathrm{win}(n)=\bigvee_{m\in\{1,3,4\},\ m\le n}\ \neg\,\mathrm{win}(n-m),\qquad \mathrm{win}(0)=\text{false}$$

Filling in from $0$ upwards settles every position with one visit each. Alongside it, the number of moves to the finish under best play is carried.

Question: what does the finished labelling answer, and what does it not?

2. Painting Backwards

Computation 2.1: positions $0$ to $1000$ were painted. The first twenty losing positions are $0$, $2$, $7$, $9$, $14$, $16$, $21$, $23$, $28$, $30$, $35$, $37$, $42$, $44$, $49$, $51$, $56$, $58$, $63$ and $65$.

countedvalue
losing positions$286$
positions congruent to $0$ or $2$ modulo $7$$286$
losing positions outside the congruence$0$
positions in the congruence that win$0$

Observation 2.2 neither direction disagrees. Both “losing implies congruent” and “congruent implies losing” were counted, and both give $0$: counting one direction alone would miss counterexamples of the other.

Observation 2.3 the period $7$ cannot be read off the moves. The moves are $1$, $3$ and $4$, and neither their sum nor their largest is $7$. It is a number that appears only once the painting is done.

Observation 2.4 the ends are plain. Position $0$ loses because nothing can be taken, and $1$, $3$, $4$ win because one move reaches $0$: the first few can be checked by hand, and from there it is enumeration.

3. One Label, Many Move Counts

Computation 3.1: alongside the labelling, the number of moves to the finish under best play was carried.

positionlabelmoves to the finish
$10$win$5$
$20$win$11$
$50$win$29$
$100$lose$58$
$500$win$285$
$1000$win$571$

Observation 3.2 this is the core. The label carries no count. Among winning positions the move counts run from $1$ to $571$ and take $286$ distinct values: all of that is folded into the single word “win”.

Observation 3.3 the count cannot be added afterwards. Looking only at the finished labels, no position’s move count can be recovered: the count is a quantity carried during the painting, not a function of the labels.

4. Searching Forwards Revisits

Computation 4.1: the number of positions visited by a forward search without memory was counted.

positionforwardsbackwardsratio
$10$$168$$11$$15.272727$
$15$$1869$$16$$116.812500$
$20$$20736$$21$$987.428571$
$25$$229970$$26$$8845.000000$

Observation 4.2 the ratio climbs steeply with the position. At position $25$ it is $8845$, because a forward search reaches the same position by many routes and reads it again each time.

Observation 4.3 the backward count is just the number of positions. Up to position $n$ it visits $n+1$, because nothing painted is ever painted twice.

5. The Separator

Observation 5.1 the separator is whether one asks whether you can win or in how many moves. The label answers the first and not the second: within the same painting, one is an output and the other vanishes unless it is made one.

Observation 5.2 placed beside Paper 602. 602 showed that who wins at Nim is decided by addition without carries. There several heaps and a closed formula giving the answer directly; here one heap with no formula and nothing to do but paint. Both answer “can you win”, by different means. Paper 300 showed that whether two things share a root is decidable: label and move count are distinct roots by that criterion.

Observation 5.3 what is not said. Real games, a proof of the period and other move sets are not treated. What is shown is that a cheap way of solving need not answer everything one wants to ask.

6. Census and Closing

  1. $286$ losing positions (Computation 2.1): up to $1000$.
  2. congruent to $0$ or $2$ modulo $7$ (Computation 2.1): $0$ either way.
  3. the period is not in the moves (Observation 2.3): it appears on painting.
  4. $286$ distinct move counts (Observation 3.2): the core.
  5. from $1$ to $571$ (Computation 3.1): folded into one word.
  6. the count cannot be added later (Observation 3.3): not a function of labels.
  7. $229970$ forwards at position $25$ (Computation 4.1): without memory.
  8. $26$ backwards (Computation 4.1): ratio $\mathbf{8845.000000}$.
  9. backwards equals the positions (Observation 4.3): never twice.
  10. whether, or how many (Observation 5.1): the separator; Papers 602, 300.

Closing: Whether you can win is settled by painting backwards; how many moves it takes is not in that label. Painting positions $0$ to $1000$ of the game where $1$, $3$ or $4$ stones may be taken gives $286$ losing positions, exactly those congruent to $0$ or $2$ modulo $7$, with no disagreement in either direction: and the period $7$ is a number that appears only once the painting is done, not one readable from the moves $1$, $3$, $4$. Yet within the single label “win” the number of moves takes $286$ distinct values from $1$ to $571$, and none of them can be recovered from the labels alone, because the count is carried during the painting and is not a function of the labels. Painting is also cheap: at position $25$ a forward search visits $229970$ positions against $26$ backwards, a ratio of $8845.000000$. Placed among the earlier papers: beside Paper 602’s “a closed formula gives the answer directly”, as the side with no formula, and treating label and move count as distinct roots by the criterion of Paper 300. To be honest: only the move set $1$, $3$, $4$ was examined, and the period $7$ was not proved.

References

  1. Berlekamp, E. R., Conway, J. H., & Guy, R. K. (2001). Winning Ways for Your Mathematical Plays. A K Peters.
  2. Yamagishi, Y. (2026). The Three Hundredth Census: Whether Two Things Share a Root Is Decidable [Paper 300]. YOI: https://www.yamagishiyuuki.com/yoi/300; DOI: 10.5281/zenodo.22171914
  3. Yamagishi, Y. (2026). Who Wins at Nim Is Decided by Addition Without Carries [Paper 602]. YOI: https://www.yamagishiyuuki.com/yoi/602; DOI: 10.5281/zenodo.22805951

Reference

Yamagishi, Y. (2026). Whether You Can Win Is Settled by Painting Backwards; How Many Moves It Takes Is Not in That Label [Paper 846]. YOI: https://www.yamagishiyuuki.com/yoi/846
ORCID: 0009-0006-8587-3450

PDF (English) · PDF (Japanese) · Date proof of the English PDF (OpenTimestamps .ots) · SHA256SUMS

The record page for this paper (in Japanese, with the PDFs in each language and the date proof): YOI 846. This paper is a preprint and has not been peer reviewed.