login
A272995
Number of active (ON, black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 573", based on the 5-celled von Neumann neighborhood.
4
1, 8, 20, 41, 60, 101, 141, 189, 213, 285, 393, 457, 501, 617, 696, 793, 805, 941, 1257, 1353, 1429, 1601, 1721, 1869, 1969, 2205, 2457, 2641, 2697, 2993, 3085, 3249, 3081, 3445, 4229, 4333, 4429, 4697, 5065, 5305, 5409, 5841, 6097, 6333, 6473, 6929, 7253
OFFSET
0,2
COMMENTS
Initialized with a single black (ON) cell at stage zero.
REFERENCES
S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.
MATHEMATICA
CAStep[rule_, a_]:=Map[rule[[10-#]]&, ListConvolve[{{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}, a, 2], {2}];
code=573; stages=128;
rule=IntegerDigits[code, 2, 10];
g=2*stages+1; (* Maximum size of grid *)
a=PadLeft[{{1}}, {g, g}, 0, Floor[{g, g}/2]]; (* Initial ON cell on grid *)
ca=a;
ca=Table[ca=CAStep[rule, ca], {n, 1, stages+1}];
PrependTo[ca, a];
(* Trim full grid to reflect growth by one cell at each stage *)
k=(Length[ca[[1]]]+1)/2;
ca=Table[Table[Part[ca[[n]][[j]], Range[k+1-n, k-1+n]], {j, k+1-n, k-1+n}], {n, 1, k}];
Map[Function[Apply[Plus, Flatten[#1]]], ca] (* Count ON cells at each stage *)
CROSSREFS
Sequence in context: A272842 A272924 A272943 * A273111 A273175 A318071
KEYWORD
nonn,easy
AUTHOR
Robert Price, May 12 2016
STATUS
approved