Chapter 5: Two Dimensions and Beyond

Section 2: Cellular Automata

Symmetric 5-neighbor [2D cellular automaton] rules

Among the 32 possible 5-cell neighborhoods shown for example on page 941 there are 12 classes related by symmetries, given by

s = {{1},{2,3,9,17},{4,10,19,25},{5},{6,7,13,21},{8,14,23,29},{11,18}, {12,20,26,27},{15,22},{16,24,30,31},{28},{32}}

Completely symmetric 5-neighbor rules can be numbered from 0 to 4095, with each digit specifying the new color of the cell for each of these symmetry classes of neighborhoods. Such rule numbers can be converted to general form using

FromDigits[ Map[Last, Sort[Flatten[Map[Thread, Thread[{s, IntegerDigits[n, 2, 12]}]], 1]]], 2]

From Stephen Wolfram: A New Kind of Science [citation]