%I #26 Aug 07 2021 16:17:00
%S 1,1,4,8,15,23,34,46,61,77,96,116,139,163,190,218,249,281,316,352,391,
%T 431,474,518,565,613,664,716,771,827,886,946,1009,1073,1140,1208,1279,
%U 1351,1426,1502,1581,1661,1744,1828,1915,2003,2094,2186,2281,2377,2476
%N a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3, with initial terms 1, 1, 4, 8.
%C Also, total number of ON (black) cells after n iterations of the "Rule 201" elementary cellular automaton starting with a single ON (black) cell.
%D S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.
%H Robert Price, <a href="/A267682/b267682.txt">Table of n, a(n) for n = 0..1000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/ElementaryCellularAutomaton.html">Elementary Cellular Automaton</a>
%H S. Wolfram, <a href="http://wolframscience.com/">A New Kind of Science</a>
%H <a href="/index/Ce#cell">Index entries for sequences related to cellular automata</a>
%H <a href="https://oeis.org/wiki/Index_to_Elementary_Cellular_Automata">Index to Elementary Cellular Automata</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1).
%F G.f.: (1 - x + 2*x^2 + 2*x^3) / ((1-x)^3*(1+x)). - _Colin Barker_, Jan 19 2016
%F a(n) = n*(n-1) + floor(n/2) + 1. - _Karl V. Keller, Jr._, Jul 14 2021
%F E.g.f.: (exp(x)*(2 + x + 2*x^2) - sinh(x))/2. - _Stefano Spezia_, Jul 16 2021
%t 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 *)
%t LinearRecurrence[{2, 0, -2, 1}, {1, 1, 4, 8}, 60] (* _Vincenzo Librandi_, Jan 19 2016 *)
%o (PARI) Vec((1-x+2*x^2+2*x^3)/((1-x)^3*(1+x)) + O(x^100)) \\ _Colin Barker_, Jan 19 2016
%o (Python) print([n*(n-1)+n//2+1 for n in range(51)]) # _Karl V. Keller, Jr._, Jul 14 2021
%Y Cf. A267679.
%Y Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
%Y 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.
%Y Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.
%K nonn,easy
%O 0,3
%A _Robert Price_, Jan 19 2016
%E Edited by _N. J. A. Sloane_, Jul 25 2018, replacing definition with simpler formula provided by _Colin Barker_, Jan 19 2016.