login
Number of possible plays on the n-th move in Mirror Chess in which Black's play is always the mirror image of White (White must either mate or play such that Black can mirror the move).
2

%I #29 Dec 08 2021 05:35:39

%S 1,20,437,10461,270726,7456194,215666696,6485151199,201183083017,

%T 6401210746834,207969967925893,6875935591529309

%N Number of possible plays on the n-th move in Mirror Chess in which Black's play is always the mirror image of White (White must either mate or play such that Black can mirror the move).

%C By the number of possible plays on the n-th move is meant the total number of legal lines of play for white under the rules of mirror chess at a depth of n moves from the standard initial position.

%C If white cannot play a legal move under the rules of mirror chess then the game is considered to be a draw.

%C Among the 270726 possibilities up to move 4, only 3 correspond to games ending in checkmate, all at move 4: see examples. - _M. F. Hasler_, Dec 08 2021

%H Jeremy Gardiner, <a href="http://www.woomerang.com/mchess/">Mirror Chess</a>

%H Jeremy Gardiner, <a href="/A136257/a136257.txt">Mirror Chess 3 moves supplied by Francois Labelle</a>

%e A checkmate cannot occur earlier than at move 4, where we have the following possibilities: 1.d4 d5 2.Qd3 Qd6 3.Qf5 Qf4 4.Qxc8# or 3.Qh3 Qh6 4.Qxc8#, and

%e 1.c4 c5 2.Qa4 Qa5 3.Qc6 Qc3 4.Qxc8#, corresponding to the following diagrams:

%e r n Q . k b n r r n Q . k b n r r n Q . k b n r

%e p p p . p p p p p p p . p p p p p p . p p p p p

%e . . . . . . . . . . . . . . . q . . . . . . . .

%e . . . p . . . . . . . p . . . . . . p . . . . .

%e . . . P . q . . . . . P . . . . . . P . . . . .

%e . . . . . . . . . . . . . . . . . . q . . . . .

%e P P P . P P P P P P P . P P P P P P . P P P P P

%e R N B . K B N R R N B . K B N R R N B . K B N R

%e where upper/lowercase letters represent white/black pieces, and dots stand for empty squares. - _M. F. Hasler_, Dec 08 2021

%o (Python)

%o import chess

%o def A136257(n, B=chess.Board()):

%o if n == 0: return 1

%o count = 0

%o for m in B.legal_moves:

%o B.push(m)

%o if B.is_checkmate():

%o if n == 1: count += 1

%o else:

%o m.from_square ^= 56

%o m.to_square ^= 56 # reverse ranks through XOR with 7

%o if B.is_legal(m):

%o if n == 1: count += 1

%o else:

%o B.push(m)

%o count += A136257(n - 1, B)

%o B.pop()

%o B.pop()

%o return count # M. F. Hasler, Dec 08 2021

%Y Cf. A048987.

%K nonn,hard,more,fini

%O 0,2

%A _Jeremy Gardiner_, Apr 18 2008

%E a(2) corrected and a(3) from _Jeremy Gardiner_, Mar 03 2013

%E a(3) corrected and a(4)-a(11) from _François Labelle_, Apr 12 2015