login
A395818
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) gives, among the first n pieces, the number of Black pieces with a record index when placed minus the number of Red pieces with a record index when placed.
2
1, 0, 1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 4, 4, 3, 4, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 1, 1, 0, 0, -1, 0, -1, 0, 0, 1, 1, 2, 2, 3, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -3, -3, -4, -4, -5, -5, -6, -6, -7, -7, -8, -8, -9, -9, -10, -10, -11, -11, -12, -12, -13, -13
OFFSET
1,7
EXAMPLE
The first terms are:
n a(n) |A395355(n-1)| Color Record?
-- ---- -------------- ----- -------
1 1 0 Black Yes
2 0 1 Red Yes
3 1 2 Black Yes
4 0 3 Red Yes
5 1 5 Black Yes
6 1 4 Red No
7 2 9 Black Yes
8 2 6 Red No
9 3 11 Black Yes
10 3 10 Red No
11 4 15 Black Yes
12 4 12 Red No
13 5 20 Black Yes
14 4 24 Red Yes
15 4 21 Black No
PROG
(PARI) \\ See Links section.
CROSSREFS
KEYWORD
sign
AUTHOR
Rémy Sigrist, May 07 2026
STATUS
approved