OFFSET
0,3
COMMENTS
On the infinite square grid, start with all cells OFF.
Turn a single cell to the ON state.
At each subsequent step, each cell with exactly one or two neighbors ON is turned ON, and everything that is already ON remains ON.
Here "neighbor" refers to the eight adjacent and diagonally adjacent cells in the Moore neighborhood.
LINKS
EXAMPLE
The first 5 generations can be depicted as follows:
. . . . . . . . . . .
. 5 5 . . . . . 5 5 .
. 5 4 4 4 4 4 4 4 5 .
. . 4 3 3 . 3 3 4 . .
. . 4 3 2 2 2 3 4 . .
. . 4 . 2 1 2 . 4 . .
. . 4 3 2 2 2 3 4 . .
. . 4 3 3 . 3 3 4 . .
. 5 4 4 4 4 4 4 4 5 .
. 5 5 . . . . . 5 5 .
. . . . . . . . . . .
- so a(0) = 0,
a(1) = 0 + 1 = 1,
a(2) = 1 + 8 = 9,
a(3) = 9 + 12 = 21,
a(4) = 21 + 24 = 45,
a(5) = 45 + 12 = 57.
PROG
(C++) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Jan 08 2022
STATUS
approved