cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A358021 Lexicographically earliest sequence of distinct nonnegative integers on a square spiral such that no number shares a digit with any of its eight surrounding neighbors.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 30, 44, 10, 55, 11, 20, 13, 66, 12, 33, 14, 22, 15, 23, 16, 24, 57, 18, 25, 36, 27, 48, 26, 34, 56, 47, 28, 50, 49, 58, 60, 29, 35, 67, 38, 40, 77, 59, 37, 19, 68, 39, 46, 70, 41, 80, 31, 65, 90, 17, 88, 21, 93, 51, 43, 69, 71, 32, 111, 73, 81, 64, 72, 89, 42, 91
Offset: 0

Views

Author

Scott R. Shannon and Eric Angelini, Oct 24 2022

Keywords

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.

Examples

			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