login
In the spiral discussed in A392177 and A392178, squares not occupied by a knight of either color.
12

%I #21 Feb 07 2026 20:41:36

%S 7,8,13,14,16,17,18,19,22,23,26,27,28,29,32,33,38,39,43,45,46,51,52,

%T 53,54,59,60,62,73,74,77,79,80,91,92,94,97,98,100,101,102,103,104,105,

%U 106,107,108,113,118,119,122,123,124,125,128,129,130,131,134,135,140,146,151,153,157,158,159,160,163,165,166,168,170,172,173

%N In the spiral discussed in A392177 and A392178, squares not occupied by a knight of either color.

%C A392177, A392178, and this sequence together partition the nonnegative integers.

%H Michael S. Branicky, <a href="/A392179/b392179.txt">Table of n, a(n) for n = 1..50000</a> (terms 1..3923 from N. J. A. Sloane)

%o (Python)

%o from itertools import count, islice

%o def square_spiral(): # generator of square spiral coordinates

%o i, j, di, dj, L = 0, 0, 1, 0, 1

%o yield i, j

%o while True:

%o for s in range(2):

%o for k in range(L):

%o i, j = i+di, j+dj

%o yield i, j

%o di, dj = -dj, di

%o L += 1

%o def agen(): # 0, 1 = Black, Red

%o p, g = {0: set(), 1: set()}, {0: square_spiral(), 1: square_spiral()}

%o K = {(0, 0), (2, 1), (1, 2), (-1, 2), (-2, 1), (-2, -1), (-1, -2), (1, -2), (2, -1)}

%o m, n, occupied = [-1, -1], -1, set()

%o while True:

%o for turn in (0, 1):

%o for k in count(m[turn]+1):

%o loc = next(g[turn])

%o if all((loc[0]+i, loc[1]+j) not in p[1-turn] for i, j in K):

%o p[turn].add(loc)

%o m[turn] = k

%o occupied.add(k)

%o break

%o for n in range(n+1, min(m)+1):

%o if n not in occupied:

%o yield n

%o print(list(islice(agen(), 75))) # _Michael S. Branicky_, Feb 07 2026

%Y Cf. A392177-A392180.

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Feb 07 2026