%I #12 Jun 02 2026 12:55:09
%S 0,1,32,2,64,3,1024,16,8,68,4,6,5,48,10,128,12,18,4096,34,40,256,512,
%T 130,66,42,17,9,96,33,24,14,11,258,136,520,260,8192,2048,72,138,
%U 131072,100,528,2080,20,514,160,36,65,104,73,19,67,21,26,168,74,162,1028,288
%N Lexicographically earliest sequence of distinct nonegative integers whose binary values, when written on a square spiral, one bit per square, high order bits first, contain no pair of 1 bits that are a knight's move apart.
%C After a(0) = 0 when determining the next term in the sequence one must not only ensure that it contains no 1 bits that are a knight's move apart from any previous 1 bit, including the earlier 1 bits in the term itself, but also that the next square after the end of the term is not a knight's move apart from any previous 1 bit as the next term must begin with a 1 bit.
%C It is conjectured that the sequence contains all nonnegative integers.
%H Scott R. Shannon, <a href="/A396603/b396603.txt">Table of n, a(n) for n = 0..1000</a>
%H Scott R. Shannon, <a href="/A396603/a396603.png">Image of the first 1000 terms on the square spiral</a>. The 1 bits are black while the 0 bits are light gray. The bits that comprise each term are connected by a red line.
%e The spiral begins:
%e .
%e .
%e 0---1---0---0---0---0---1 1
%e | | |
%e 0 0---0---0---0---0 0 1
%e | | | | |
%e 0 1 0---0---1 0 0 0
%e | | | | | | |
%e 1 1 0 0---1 1 0 1
%e | | | | | |
%e 0 1 0---0---1---0 0 0
%e | | | |
%e 0 0---0---0---0---0---0 1
%e | |
%e 0---1---0---0---1---0---0---1
%e .
%e a(0) = 0 by definition.
%e a(1) = 1 as there are no 1 other bits on the spiral, and the third square, the next square after the end of a(1) = 1, can contain a 1 bit as it is not a knight's move away from any existing 1 bit.
%e a(2) = 32. The 5th square cannot contain a 1 bit as it is a knight's move away from the 2nd square which contains a 1 bit, so a(2) cannot be 2 or 3. Likewise the 6th, 7th and 8th square cannot contain a 1 bit, leaving 32 as the smallest number that contains no 1 bits in these squares while allowing a 1 bit in the 9th square to start the fourth term.
%Y Cf. A396604 (start at 1), A007088, A396607, A396608, A394166.
%K nonn,base
%O 0,3
%A _Scott R. Shannon_, May 30 2026