login
A270618
Number of active (ON, black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 177", based on the 5-celled von Neumann neighborhood.
4
1, 4, 9, 32, 33, 84, 65, 160, 77, 312, 121, 412, 221, 556, 256, 757, 316, 1009, 308, 1197, 452, 1453, 560, 1833, 608, 2125, 760, 2393, 932, 2785, 1152, 2908, 1205, 3708, 1037, 3996, 1337, 4456, 1537, 5124, 1685, 5360, 1713, 6004, 2149, 6600, 2501, 7052, 2777
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=177; 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: A071378 A053192 A338576 * A270634 A324020 A265645
KEYWORD
nonn,easy
AUTHOR
Robert Price, Mar 20 2016
STATUS
approved