OFFSET
0,2
LINKS
Robert Price, Table of n, a(n) for n = 0..499
Eric Weisstein's World of Mathematics, Rule 158
Eric Weisstein's World of Mathematics, Elementary Cellular Automaton
Stephen Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.
Index entries for linear recurrences with constant coefficients, signature (0,10001,0,-10000).
FORMULA
From Colin Barker, Dec 14 2015 and Apr 18 2019: (Start)
a(n) = 10001*a(n-2) - 10000*a(n-4) for n>3.
G.f.: (1+111*x+1100*x^2-100*x^3) / ((1-x)*(1+x)*(1-100*x)*(1+100*x)).
(End)
a(n) = floor((11100 - (n mod 2))*100^n/9999). - Karl V. Keller, Jr., Sep 20 2021
EXAMPLE
From Michael De Vlieger, Dec 09 2015: (Start)
First 12 rows:
1
1 1 1
1 1 1 0 1
1 1 1 0 0 1 1
1 1 1 0 1 1 1 0 1
1 1 1 0 0 1 1 0 0 1 1
1 1 1 0 1 1 1 0 1 1 1 0 1
1 1 1 0 0 1 1 0 0 1 1 0 0 1 1
1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1
1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1
1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1
(End)
MATHEMATICA
rule = 158; rows = 20; Table[FromDigits[Table[Take[CellularAutomaton[rule, {{1}, 0}, rows-1, {All, All}][[k]], {rows-k+1, rows+k-1}], {k, 1, rows}][[k]]], {k, 1, rows}]
PROG
(Python) print([(11100 - (n%2))*100**n//9999 for n in range(30)]) # Karl V. Keller, Jr., Sep 20 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Robert Price, Dec 07 2015
STATUS
approved