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 A052917 #47 Jul 02 2025 16:01:58 %S A052917 1,3,9,27,82,249,756,2295,6967,21150,64206,194913,591706,1796268, %T A052917 5453010,16553943,50253535,152556873,463123629,1405924830,4268028025, %U A052917 12956640948,39333046473,119405064249,362483220772,1100406303264 %N A052917 Expansion of 1/(1-3*x-x^4). %C A052917 a(n) equals the number of n-length words on {0,1,2,3} such that 0 appears only in a run whose length is a multiple of 4. - _Milan Janjic_, Feb 17 2015 %H A052917 G. C. Greubel, <a href="/A052917/b052917.txt">Table of n, a(n) for n = 0..1000</a> %H A052917 INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=900">Encyclopedia of Combinatorial Structures 900</a> %H A052917 Milan Janjic, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL19/Janjic/janjic73.html">Binomial Coefficients and Enumeration of Restricted Words</a>, Journal of Integer Sequences, 2016, Vol 19, #16.7.3 %H A052917 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (3,0,0,1). %F A052917 G.f.: 1/(1 - 3*x - x^4). %F A052917 a(n) = 3*a(n-1) + a(n-4), with a(0)=1, a(1)=3, a(2)=9, a(3)=27. %F A052917 a(n) = Sum_{alpha=RootOf(-1 + 3*z + z^4)} (1/2443)*(729 + 64*alpha + 144*alpha^2 + 324*alpha^3)*alpha^(-1-n). %p A052917 spec := [S,{S=Sequence(Union(Z,Z,Z,Prod(Z,Z,Z,Z)))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20); %p A052917 seq(coeff(series(x^4/((1+2*x)*(2*x^3+x^2-2*x+1)), x, n+1), x, n), n = 0..30); # _G. C. Greubel_, Oct 16 2019 %t A052917 CoefficientList[Series[1/(1-3x-x^4), {x, 0, 30}], x] (* _Vincenzo Librandi_, Feb 20 2015 *) %t A052917 RecurrenceTable[{a[0]==1, a[1]==3, a[2]==9, a[3]==27, a[n]==3a[n-1] +a[n -4]}, a[n], {n, 0, 30}] (* _Bruno Berselli_, Feb 20 2015 *) %o A052917 (PARI) Vec(1/(1-3*x-x^4) + O(x^30)) \\ _Michel Marcus_, Feb 17 2015 %o A052917 (Magma) [n le 4 select 3^(n-1) else 3*Self(n-1)+Self(n-4): n in [1..30]]; // _Vincenzo Librandi_, Feb 20 2015 %o A052917 (Sage) %o A052917 def A052917_list(prec): %o A052917 P.<x> = PowerSeriesRing(ZZ, prec) %o A052917 return P(1/(1-3*x-x^4)).list() %o A052917 A052917_list(30) # _G. C. Greubel_, Oct 16 2019 %o A052917 (GAP) a:=[1,3,9,27];; for n in [5..30] do a[n]:=3*a[n-1]+a[n-4]; od; a; # _G. C. Greubel_, Oct 16 2019 %o A052917 (Magma) R<x>:=PowerSeriesRing(Integers(), 27); Coefficients(R!( 1/(1-3*x-x^4) )); // _Marius A. Burtea_, Oct 16 2019 %K A052917 nonn,easy %O A052917 0,2 %A A052917 encyclopedia(AT)pommard.inria.fr, Jan 25 2000 %E A052917 More terms from _James Sellers_, Jun 06 2000