login
A269910
Number of active (ON, black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 3", based on the 5-celled von Neumann neighborhood.
4
1, 5, 1, 45, 1, 117, 1, 221, 1, 357, 1, 525, 1, 725, 1, 957, 1, 1221, 1, 1517, 1, 1845, 1, 2205, 1, 2597, 1, 3021, 1, 3477, 1, 3965, 1, 4485, 1, 5037, 1, 5621, 1, 6237, 1, 6885, 1, 7565, 1, 8277, 1, 9021, 1, 9797, 1, 10605, 1, 11445, 1, 12317, 1, 13221, 1
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.
FORMULA
Conjectures from Colin Barker, Mar 08 2016: (Start)
a(n) = (-1+2*(-1)^n-2*(-1+(-1)^n)*n-2*(-1+(-1)^n)*n^2).
a(n) = 1 for n even.
a(n) = 4*n^2+4*n-3 for n odd.
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6) for n>5.
G.f.: (1+5*x-2*x^2+30*x^3+x^4-3*x^5) / ((1-x)^3*(1+x)^3).
(End)
MATHEMATICA
CAStep[rule_, a_]:=Map[rule[[10-#]]&, ListConvolve[{{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}, a, 2], {2}];
code=3; 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: A039922 A192353 A255979 * A221366 A134274 A134275
KEYWORD
nonn,easy
AUTHOR
Robert Price, Mar 07 2016
STATUS
approved