This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A118171 #43 Feb 16 2025 08:33:00 %S A118171 1,7,29,115,477,1843,7645,29491,122333,471859,1957341,7549747, %T A118171 31317469,120795955,501079517,1932735283,8017272285,30923764531, %U A118171 128276356573,494780232499,2052421705181,7916483719987,32838747282909,126663739519795,525419956526557 %N A118171 Decimal representation of n-th iteration of the Rule 158 elementary cellular automaton starting with a single black cell. %H A118171 Colin Barker, <a href="/A118171/b118171.txt">Table of n, a(n) for n = 0..1000</a> %H A118171 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Rule158.html">Rule 158</a> %H A118171 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/ElementaryCellularAutomaton.html">Elementary Cellular Automaton</a> %H A118171 <a href="/index/Ce#cell">Index entries for sequences related to cellular automata</a> %H A118171 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,17,0,-16). %F A118171 a(n) = (1/30)*(-16+(-4)^n-10*(-1)^n+55*4^n). %F A118171 From _Colin Barker_, Oct 08 2015: (Start) %F A118171 a(n) = 17*a(n-2) - 16*a(n-4) for n>3. %F A118171 G.f.: -(4*x^3-12*x^2-7*x-1) / ((x-1)*(x+1)*(4*x-1)*(4*x+1)). %F A118171 (End) %F A118171 a(n) = floor(28*4^n/15) for even n>=0; a(n) = floor(27*4^n/15) for odd n. - _Karl V. Keller, Jr._, Oct 09 2020 %e A118171 1; %e A118171 1, 1, 1; %e A118171 1, 1, 1, 0, 1; %e A118171 1, 1, 1, 0, 0, 1, 1; %e A118171 1, 1, 1, 0, 1, 1, 1, 0, 1; %e A118171 ... %e A118171 From _Michael De Vlieger_, Oct 08 2015: (Start) %e A118171 First 8 rows, representing ON cells as "1", OFF cells within the bounds %e A118171 of ON cells as "0", interpreted as a binary number at left, the decimal %e A118171 equivalent appearing at right: %e A118171 1 = 1 %e A118171 111 = 7 %e A118171 1 1101 = 29 %e A118171 111 0011 = 115 %e A118171 1 1101 1101 = 477 %e A118171 111 0011 0011 = 1843 %e A118171 1 1101 1101 1101 = 7645 %e A118171 111 0011 0011 0011 = 29491 %e A118171 11101 1101 1101 1101 = 122333 %e A118171 (End) %t A118171 Table[(-16 + (-4)^n - 10 (-1)^n + 55*4^n)/30, {n, 0, 24}] (* or *) %t A118171 clip[lst_] := Block[{p = Flatten@ Position[lst, 1]}, Take[lst, {Min@ p, Max@ p}]]; FromDigits[#, 2] & /@ Map[clip, CellularAutomaton[158, {{1}, 0}, 24]] (* _Michael De Vlieger_, Oct 08 2015 *) %o A118171 (PARI) Vec(-(4*x^3-12*x^2-7*x-1)/((x-1)*(x+1)*(4*x-1)*(4*x+1)) + O(x^30)) \\ _Colin Barker_, Oct 08 2015 %o A118171 (PARI) vector(100, n, n--; (1/30)*(-16+(-4)^n-10*(-1)^n+55*4^n)) \\ _Altug Alkan_, Oct 08 2015 %o A118171 (Python) print([27*4**n//15 if n%2 else 28*4**n//15 for n in range(50)]) # _Karl V. Keller, Jr._, May 07 2022 %Y A118171 Cf. A071037 (cells), A265379 (binary). %K A118171 nonn,base,easy %O A118171 0,2 %A A118171 _Eric W. Weisstein_, Apr 13 2006