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 A099786 #18 Sep 08 2022 08:45:15 %S A099786 1,3,9,27,82,255,819,2727,9397,33312,120537,441855,1631017,6036879, %T A099786 22345074,82589247,304612975,1120960983,4116353265,15088372416, %U A099786 55224373105,201895801851,737506551321,2692518758163,9826402960882 %N A099786 a(n) = Sum_{k=0..floor(n/4)} C(n-k,3*k)*3^(n-4*k). %C A099786 In general a(n) = Sum_{k=0..floor(n/4)} C(n-k,3*k) * u^k * v^(n-4*k) has g.f. (1-v*x)^2/((1-v*x)^3 - u*x^4) and satisfies the recurrence a(n) = 3*v*a(n-1) - 3*v^2*a(n-2) + v^3*a(n-3) + u*a(n-4). %H A099786 G. C. Greubel, <a href="/A099786/b099786.txt">Table of n, a(n) for n = 0..1000</a> %H A099786 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (9,-27,27,1). %F A099786 G.f.: (1-3*x)^2/((1-3*x)^3 - x^4). %F A099786 a(n) = 9*a(n-1) - 27*a(n-2) + 27*a(n-3) + a(n-4). %p A099786 seq(coeff(series((1-3*x)^2/((1-3*x)^3 - x^4), x, n+1), x, n), n = 0..30); # _G. C. Greubel_, Sep 04 2019 %t A099786 LinearRecurrence[{9,-27,27,1},{1,3,9,27},40] (* or *) CoefficientList[ Series[-((1-3 x)^2/(x (x (x (x+27)-27)+9)-1)),{x,0,40}],x] (* _Harvey P. Dale_, Jun 06 2011 *) %o A099786 (PARI) my(x='x+O('x^30)); Vec((1-3*x)^2/((1-3*x)^3 - x^4)) \\ _G. C. Greubel_, Sep 04 2019 %o A099786 (Magma) I:=[1,3,9,27]; [n le 4 select I[n] else 9*Self(n-1) - 27*Self(n-2) + 27*Self(n-3) +Self(n-4): n in [1..30]]; // _G. C. Greubel_, Sep 04 2019 %o A099786 (Sage) %o A099786 def A099786_list(prec): %o A099786 P.<x> = PowerSeriesRing(ZZ, prec) %o A099786 return P((1-3*x)^2/((1-3*x)^3 - x^4)).list() %o A099786 A099786_list(30) # _G. C. Greubel_, Sep 04 2019 %o A099786 (GAP) a:=[1,3,9,27];; for n in [5..30] do a[n]:=9*a[n-1]-27*a[n-2] + 27*a[n-3] +a[n-4]; od; a; # _G. C. Greubel_, Sep 04 2019 %Y A099786 Cf. A003522, A097119. %Y A099786 Cf. A099780, A099781, A099782, A099783, A099784, A099785, A099787. %K A099786 easy,nonn %O A099786 0,2 %A A099786 _Paul Barry_, Oct 26 2004