login
A395486
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
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, 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, -15, 17, -16, -17, 0, 0, 18, 0, -18, -19, 19, -20, 20, -21, 21, 22
OFFSET
0,3
COMMENTS
Each nonzero integer appears exactly once.
LINKS
FORMULA
a(A392177(k)) = +k.
a(A392178(k)) = -k.
a(A392179(k)) = 0.
A392180(n) = Sum_{k = 0..n} sign(a(k)).
EXAMPLE
The first terms alongside the square spiral are:
0__32___0___0_-30_-29___0__31___0___0_-28
| |
0 -19_-18___0__18___0___0_-17_-16__17 30
| | | |
0 19 11_-10__-9___0___0__10___9 -15 -27
| | | | | |
0 -20 -11 0___6___0___0__-6 0 0 29
| | | | | | | |
0 20 0 0 -3__-2___2 5 0 0 -26
| | | | | | | | | |
0 -21 0 0 3 1__-1 -5 0 0 28
| | | | | | | | |
0 21 12 0 -4___0___0___4 0 0 -25
| | | | | | |
0 22 -12 7___8___0___0__-7__-8 16 27
| | | | |
0 23 13___0_-13___0___0__14__15_-14 -24
| | |
33 -22___0___0__24__25___0_-23___0___0__26
|
34__35__36___0_-31_-32__37__38___0___0_-33
PROG
(C#) // Use program provided in A392177 with the 3 arguments "- - layout".
CROSSREFS
KEYWORD
sign
AUTHOR
Rémy Sigrist, Apr 25 2026
STATUS
approved