login
Consider the square spiral with its cells numbered starting at 0. Two players, Black and Red, take turns. When it is Black's turn, he places a knight at the smallest unoccupied cell not attacked by an existing Red knight, and when it is Red's turn, she places a knight at the smallest unoccupied cell not attacked by an existing Black knight. a(n) = +k if the n-th cell is occupied by the k-th Black knight, a(n) = -k if the n-th cell is occupied by the k-th Red knight, a(n) = 0 otherwise.
4

%I #11 Apr 26 2026 17:55:57

%S 1,-1,2,-2,-3,3,-4,0,0,4,-5,5,-6,0,0,6,0,0,0,0,7,8,0,0,-7,-8,0,0,0,0,

%T 9,10,0,0,-9,-10,11,-11,0,0,12,-12,13,0,-13,0,0,14,15,-14,16,0,0,0,0,

%U -15,17,-16,-17,0,0,18,0,-18,-19,19,-20,20,-21,21,22

%N Consider the square spiral with its cells numbered starting at 0. Two players, Black and Red, take turns. When it is Black's turn, he places a knight at the smallest unoccupied cell not attacked by an existing Red knight, and when it is Red's turn, she places a knight at the smallest unoccupied cell not attacked by an existing Black knight. a(n) = +k if the n-th cell is occupied by the k-th Black knight, a(n) = -k if the n-th cell is occupied by the k-th Red knight, a(n) = 0 otherwise.

%C Each nonzero integer appears exactly once.

%H Rémy Sigrist, <a href="/A395486/b395486.txt">Table of n, a(n) for n = 0..10000</a>

%F a(A392177(k)) = +k.

%F a(A392178(k)) = -k.

%F a(A392179(k)) = 0.

%F A392180(n) = Sum_{k = 0..n} sign(a(k)).

%e The first terms alongside the square spiral are:

%e 0__32___0___0_-30_-29___0__31___0___0_-28

%e | |

%e 0 -19_-18___0__18___0___0_-17_-16__17 30

%e | | | |

%e 0 19 11_-10__-9___0___0__10___9 -15 -27

%e | | | | | |

%e 0 -20 -11 0___6___0___0__-6 0 0 29

%e | | | | | | | |

%e 0 20 0 0 -3__-2___2 5 0 0 -26

%e | | | | | | | | | |

%e 0 -21 0 0 3 1__-1 -5 0 0 28

%e | | | | | | | | |

%e 0 21 12 0 -4___0___0___4 0 0 -25

%e | | | | | | |

%e 0 22 -12 7___8___0___0__-7__-8 16 27

%e | | | | |

%e 0 23 13___0_-13___0___0__14__15_-14 -24

%e | | |

%e 33 -22___0___0__24__25___0_-23___0___0__26

%e |

%e 34__35__36___0_-31_-32__37__38___0___0_-33

%o (C#) // Use program provided in A392177 with the 3 arguments "- - layout".

%Y Cf. A392177, A392178, A392179, A392180.

%K sign

%O 0,3

%A _Rémy Sigrist_, Apr 25 2026