OFFSET
0,3
COMMENTS
Also, total number of ON (black) cells after n iterations of the "Rule 201" elementary cellular automaton starting with a single ON (black) cell.
REFERENCES
S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.
LINKS
Robert Price, Table of n, a(n) for n = 0..1000
Eric Weisstein's World of Mathematics, Elementary Cellular Automaton
S. Wolfram, A New Kind of Science
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
G.f.: (1 - x + 2*x^2 + 2*x^3) / ((1-x)^3*(1+x)). - Colin Barker, Jan 19 2016
a(n) = n*(n-1) + floor(n/2) + 1. - Karl V. Keller, Jr., Jul 14 2021
E.g.f.: (exp(x)*(2 + x + 2*x^2) - sinh(x))/2. - Stefano Spezia, Jul 16 2021
MATHEMATICA
rule=201; rows=20; ca=CellularAutomaton[rule, {{1}, 0}, rows-1, {All, All}]; (* Start with single black cell *) catri=Table[Take[ca[[k]], {rows-k+1, rows+k-1}], {k, 1, rows}]; (* Truncated list of each row *) nbc=Table[Total[catri[[k]]], {k, 1, rows}]; (* Number of Black cells in stage n *) Table[Total[Take[nbc, k]], {k, 1, rows}] (* Number of Black cells through stage n *)
LinearRecurrence[{2, 0, -2, 1}, {1, 1, 4, 8}, 60] (* Vincenzo Librandi, Jan 19 2016 *)
PROG
(PARI) Vec((1-x+2*x^2+2*x^3)/((1-x)^3*(1+x)) + O(x^100)) \\ Colin Barker, Jan 19 2016
(Python) print([n*(n-1)+n//2+1 for n in range(51)]) # Karl V. Keller, Jr., Jul 14 2021
CROSSREFS
Cf. A267679.
Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
KEYWORD
nonn,easy
AUTHOR
Robert Price, Jan 19 2016
EXTENSIONS
Edited by N. J. A. Sloane, Jul 25 2018, replacing definition with simpler formula provided by Colin Barker, Jan 19 2016.
STATUS
approved