{'fraction_non_alphanumeric': 0.05143772662113163, 'fraction_numerical': 0.028164263428619614, 'mean_word_length': 3.9478514810179393, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Odd-Rule Cellular Automata on the Square Grid

An"odd-rule"cellular automaton (CA) is defined by specifying a neighborhood for each cell, with the rule that a cell turns ON if it is in the neighborhood of an odd number of ON cells at the previous generation, and otherwise turns OFF. We classify all the odd-rule CAs defined by neighborhoods which are subsets of a 3 X 3 grid of square cells. There are 86 different CAs modulo trivial symmetries. When we consider only the different sequences giving the number of ON cells after n generations, the number drops to 48, two of which are the Moore and von Neumann CAs. This classification is carried out by using the"meta-algorithm"described in an earlier paper to derive the generating functions for the 86 sequences, and then removing duplicates. The fastest-growing of these CAs is neither the Fredkin nor von Neumann neighborhood, but instead is one defined by"Odd-rule"365, which turns ON almost 75% of all possible cells.


Introduction
As in [1,2,10], our goal is to study how fast activity spreads in cellular automata (CAs): more precisely, if we start with a single ON cell, how many cells will be ON after n generations? For additional background see [4,5,6,7,9,11,12,13,14].
Continuing the investigations begun in [2,10], we consider "odd-rule" CAs, concentrating on the two-dimensional rules defined by neighborhoods that are subsets of a 3 × 3 square grid. This family of CAs includes two that were the main subject of [10], namely Fredkin's Replicator, which is based on the Moore neighborhood, and another which is based on the von Neumann neighborhood with a center cell. One of the goals of the present paper is to use the meta-algorithm from our paper [2] to obtain generating functions, with proofs, for all these sequences. This provides alternative (computer-generated) proofs of Theorems 4 and 5 of [10]. Another member of this family is the CA defined by the one-dimensional Rule 150 in the Wolfram numbering scheme [9,13,14].
The Wolfram numbering scheme is not, however, particularly convenient for dealing with these 3 × 3 neighborhoods, and in §3 we introduce a simpler numbering scheme based on reading the neighborhood as a triple of octal numbers. Section 2 gives the definitions of an odd-rule cellular automaton and the run length transform, and quotes two essential theorems from [10]. Section 3 classifies odd-rule CAs that are defined by neighborhoods that are subsets of the 3×3 grid: if we ignore trivial differences there are 86 different CAs (Theorem 3), shown in Figs. 1, 2, 3 and Tables 1, 2, 3. In Section 4 we define two CAs to be "combinatorially equivalent" if the numbers of ON cells after n generations are the same for all n. Up to combinatorial equivalence there are 48 different CAs (Theorem 4), shown in Tables 1, 2, 3. In Section 5 we discuss three further topics: which CA has the greatest growth rate ( §5.1 -the answer is unexpected), which has the slowest growth rate ( §5.2), and the question of explaining why certain pairs of CAs turn out to have the same generating function ( §5.3). The 48 distinct generating functions are given in an Appendix.

Odd-rule CAs
We consider cellular automata whose cells are centered at the points of the 2-dimensional square lattice Z 2 . Each cell is either ON or OFF, and an ON cell with center at the lattice point (i, j) ∈ Z 2 will be identified with the monomial x i y j , which we regard as an element of the ring of Laurent polynomials R := GF(2)[x, x −1 , y, y −1 ] with mod 2 coefficients. The state of the CA is specified by giving the formal sum S of all its ON cells. As long as only finitely many cells are ON, S is indeed an element of R.
An "odd-rule" CA (this name was introduced in [10], although of course the concept has been known for as long as people have been studying CAs) is defined by first specifying a neighborhood of the cell at the origin, given by an element F ∈ R listing the cells in the neighborhood. A typical example is the Moore neighborhood, which consists of the eight cells surrounding the cell at the origin (see Odd-rule 757 in Fig. 3), and is specified by The neighborhood of an arbitrary cell x r y s is obtained by shifting F so it is centered at that cell, that is, by the product x r y s F ∈ R. Given F , the corresponding odd-rule CA is defined by the rule that a cell x r y s is ON at generation n + 1 if it is the neighbor of an odd number of cells that were ON at generation n, and is otherwise OFF. Our goal is to find a n (F ), the number of ON cells at the nth generation when the CA is started in generation 0 with a single ON cell at the origin. For odd-rule CAs there is a simple formula for a n (F ). The number of nonzero terms in an element P ∈ R will be denoted by |P |. Theorem 1. [10] For an odd-rule CA with neighborhood F , the state at generation n is equal to F n , and a n (F ) = |F n |.
Definition. The run length transform of a sequence [S n , n ≥ 0] is the sequence [T n , n ≥ 0] given by Note that T n depends only on the lengths of the runs of 1s in the binary expansion of n, not on the order in which they appear. For example, since L(11) = [1,2] and L(13) = [2, 1], T 11 = T 13 = S 1 S 2 . Also T 0 = 1 (the empty product), so the value of S 0 is never used, and will usually be taken to be 1. For further properties and additional examples of the run length transform see [10]. See especially [10, Table 4], which shows how the transformed sequence has a natural division into blocks of successive lengths 1, 1, 2, 4, 8, 16, 32, . . .. Define the height ht(F ) of an element F ∈ R to be max{|i|, |j|} for any monomial x i y j in F . If ht(F ) = h, the cells in F are a subset of the cells in a (2h + 1) × (2h + 1) array of squares centered at the origin. In particular, if ht(F ) ≤ 1, we have the following:

Trivially equivalent neighborhoods
From now on we assume that F has height at most one, i.e., is a subset of the 3 × 3 grid of cells centered at the origin. In view of Theorem 1, a n (F ) is unchanged if we multiply (or divide) F by x or y (these operations simply translate the configuration of ON states in the (x, y)-plane).
We can also apply any of the eight symmetries of the square (rotations and/or reflections, forming the dihedral group of order eight) to F without changing a n (F ).
We therefore say that two neighborhoods F ∈ R, G ∈ R are trivially (or affinely) equivalent if one can be translated into the other by repeated translations, rotations, and reflections. Proof. Hand calculation, followed by computer verification.
Rather than use the Wolfram numbering scheme, which here could involve numbers as large as 2 512 , we describe the neighborhood F by a three-digit octal number, the "Odd-rule" number, obtained by reading the ON cells in the 3 × 3 grid from left to right, top to bottom.
The canonical Odd-rule number for F is then the smallest of the Odd-rule numbers associated with any neighborhood that is trivially equivalent to F .
For example, the neighborhood F = 1 + x ∈ R, consisting of two adjacent cells, can be shifted or rotated into 12 different positions, described by the octal numbers 600, 300, 060, 030, 006, 003, 440, 044, 220, 022, 110, 011. The smallest of these is 003 (corresponding to 1/y + x/y), which is therefore the canonical Odd-rule number for this F (see the the third figure in Fig. 1).
The Odd-rule number for Wolfram's one-dimensional Rule 150 is 007. The two CAs that were the main subject of [10], namely "Fredkin's Replicator", which is based on the Moore neighborhood, and the CA based on the von Neumann neighborhood with a center cell, are Odd-rules 757 and 272, respectively. The von Neumann neighborhood without the center cell is Odd-rule 252, and the full 3 × 3 neighborhood is Odd-rule 777.
The canonical Odd-rule numbers for all 86 trivially inequivalent height-one neighborhoods are shown in Figs. 1, 2, 3, which give graphical representations of the neighborhoods. These 86 neighborhoods are also shown in Tables 1, 2, 3. The first column of these tables gives the canonical Odd-rule number, the second column gives the number of cells in the neighborhood, the third column gives the binary representation of the neighborhood, and the fourth column gives the corresponding Laurent polynomial F .

Combinatorially equivalent neighborhoods
Since we are mostly interested in the sequences that give the number of ON cells after n generations, we shall say that two height-one neighborhoods F and G are combinatorially equivalent if a n (F ) = a n (G) for all n ≥ 0. In view of Theorem 2, an equivalent condition is that b n (F ) = b n (G) for all n ≥ 0. Proof. Using the Maple programs ARLT and GFsP described in [2] (available from [3]), we computed the generating function for the b n (F ) sequence corresponding to each of the 86 neighborhoods listed in Theorem 3. After removing duplicates, 48 remained (see the Appendix).
As representative for each equivalence class of neighborhoods we take the one with the smallest Odd-rule number. These 48 combinatorially inequivalent neighborhoods can be seen in Tables 1,  2, 3, where they are distinguished by having the sequence numbers in [8] for the a n (F ) and b n (F ) sequences in the final column of the tables. If the a n (F ) and b n (F ) sequences are the same as those for some earlier rule, this is indicated in the final column instead of the sequence numbers.
The generating functions for the 48 b n (F ) sequences, together with the corresponding sequence numbers, are given in the Appendix. They are shown in such a way that they can be easily copied into a computer algebra system (that is, they are given in a linear rather than two-dimensional format).
In particular, the generating functions for the Fredkin and von Neumann-with-center CAs match those derived in [10], and so provide an alternative proof for Theorems 4 and 5 of that paper. It is natural to ask which rule produces the greatest number of ON cells. We just consider the number that are ON at generation 2 n − 1, that is, the subsequence b n (F ) = a 2 n −1 (F ), since by Theorem 2 these are local maxima of the a n (F ) sequence, and all other values of a n (F ) are products of these values.
The most fecund rule is somewhat of a surprise: it is Odd-rule 365, seen in the top left figure in Fig. 3. This is the unique winner, well ahead of the more obvious candidates such as rules 252, 272, 525, 757, or 777.
For Odd-rule 365 the neighborhood is F = 1/(xy)+1/x+x/y+1+y+xy, b n (F ) = 3.4 n −2.3 n , n ≥ 0, with generating function Other rules do better at the start, but for n ≥ 4 Odd-rule 365 is the winner, and thus, for any height-one odd-rule neighborhood F , b n (F ) ≤ 3.4 n − 2.3 n for all n ≥ 4. ( Equality holds in (3) if and only if F is trivially equivalent to Odd-rule 365. After 2 n − 1 generations of any odd-rule height-one CA that starts with a single ON cell at generation 0, the ON cells are contained in the square of side 2 n+1 − 1 centered at the origin. Odd-rule 365 turns ON a fraction 3.

Explaining combinatorial equivalence.
In some cases it is easy to explain why two different neighborhoods have the same a n (and b n ) sequences, i.e., are combinatorially equivalent. Let us denote combinatorial equivalence by ∼.
All five of the trivially inequivalent two-celled neighborhoods are combinatorially equivalent-for example, rule 003, 1/y + x/y ∼ 1 + x ∼ 1/y + x, which is rule 012. To see that the four-celled rules 033 (1 + x + 1/y + x/y) and 505 (y/x + xy + 1/(xy) + x/y) are equivalent, replace x by x 2 in the former, then divide by x, replace y by y 2 , and finally multiply by y. For other pairs, such as the seven-celled rules 376 and 557, there does not seem to be a simple proof that they are combinatorially equivalent, even though we know (by the theory developed in [2]) that this is true.