OFFSET
0,3
COMMENTS
The sequence is finite; after a(264) = 177 the square at coordinate (-8,-1) relative to the starting square is reached which has the four neighbors 177, 409, 256, 308. These numbers include all digits 0 to 9 so the next term does not exist. The largest used number is a(241) = 7777 while smallest unused number is 120.
EXAMPLE
The square spiral begins:
.
.
13--20--11--55--10 36
| | |
66 4---3---2 44 25
| | | | |
12 5 0---1 30 18
| | | |
33 6---7---8---9 57
| |
14--22--15--23--16--24
.
a(10) = 30 as when the tenth square is filled its surrounding neighbors are 1, 2, 8, 9, and 30 is the smallest unused number that does not contain those digits.
CROSSREFS
KEYWORD
nonn,base,fini
AUTHOR
Scott R. Shannon and Eric Angelini, Oct 24 2022
STATUS
approved