login
A392179
In the spiral discussed in A392177 and A392178, squares not occupied by a knight of either color.
12
7, 8, 13, 14, 16, 17, 18, 19, 22, 23, 26, 27, 28, 29, 32, 33, 38, 39, 43, 45, 46, 51, 52, 53, 54, 59, 60, 62, 73, 74, 77, 79, 80, 91, 92, 94, 97, 98, 100, 101, 102, 103, 104, 105, 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
OFFSET
1,1
COMMENTS
A392177, A392178, and this sequence together partition the nonnegative integers.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..50000 (terms 1..3923 from N. J. A. Sloane)
PROG
(Python)
from itertools import count, islice
def square_spiral(): # generator of square spiral coordinates
i, j, di, dj, L = 0, 0, 1, 0, 1
yield i, j
while True:
for s in range(2):
for k in range(L):
i, j = i+di, j+dj
yield i, j
di, dj = -dj, di
L += 1
def agen(): # 0, 1 = Black, Red
p, g = {0: set(), 1: set()}, {0: square_spiral(), 1: square_spiral()}
K = {(0, 0), (2, 1), (1, 2), (-1, 2), (-2, 1), (-2, -1), (-1, -2), (1, -2), (2, -1)}
m, n, occupied = [-1, -1], -1, set()
while True:
for turn in (0, 1):
for k in count(m[turn]+1):
loc = next(g[turn])
if all((loc[0]+i, loc[1]+j) not in p[1-turn] for i, j in K):
p[turn].add(loc)
m[turn] = k
occupied.add(k)
break
for n in range(n+1, min(m)+1):
if n not in occupied:
yield n
print(list(islice(agen(), 75))) # Michael S. Branicky, Feb 07 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 07 2026
STATUS
approved