%I #27 Feb 06 2022 07:02:02
%S 1,1,4,11,31,88,249,705,1996,5651,15999,45296,128241,363073,1027924,
%T 2910235,8239391,23327176,66043369,186980481,529374876,1498754083,
%U 4243238399,12013359840,34011950561,96293859201,272624979364,771849627691,2185243073311,6186810381368
%N Expansion of (1 - x)/(1 - 2*x - 2*x^2 - x^3).
%C Equals INVERT transform of (1, 3, 4, 4, 4, ...). - _Gary W. Adamson_, Jan 03 2009
%H Harvey P. Dale, <a href="/A077995/b077995.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2, 2, 1).
%F a(n) = Sum_{m=1..n} Sum_{i=0..n-m} C(m+i-1,m-1)*Sum_{j=0..m} C(j,n-3*m +2*j-i) * C(m,j)*2^(n-3*m+2*j-i), n>0, a(0)=1. - _Vladimir Kruchinin_, May 12 2011
%F G.f.: 1 + x/(G(0)-x) where G(k) = 1 - x*(2*k+2)/(1 - 1/(1 + (2*k+2)/G(k+1)));(continued fraction, 3-step). - _Sergei N. Gladkovskii_, Nov 17 2012
%F a(n) = 2*a(n-1) + 2*a(n-2) + a(n-3); a(0)=1, a(1)=1, a(2)=4. - _Harvey P. Dale_, Sep 11 2013
%t CoefficientList[Series[(1-x)/(1-2x-2x^2-x^3),{x,0,30}],x] (* or *) LinearRecurrence[{2,2,1},{1,1,4},30] (* _Harvey P. Dale_, Sep 11 2013 *)
%o (Maxima) a(n):=sum(sum(binomial(m+i-1,m-1)*sum(binomial(j,n-3*m+2*j-i) *binomial(m,j) *2^(n-3*m+2*j-i),j,0,m) ,i,0,n-m) ,m,1,n); - _Vladimir Kruchinin_, May 12 2011
%o (PARI) Vec((1-x)/(1-2*x-2*x^2-x^3)+O(x^30)) \\ _Charles R Greathouse IV_, Sep 24 2012
%o (Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-x)/( 1-2*x-2*x^2-x^3) )); // _G. C. Greubel_, Jun 27 2019
%o (Sage) ((1-x)/(1-2*x-2*x^2-x^3)).series(x, 30).coefficients(x, sparse=False) # _G. C. Greubel_, Jun 27 2019
%o (GAP) a:=[1,1,4];; for n in [4..30] do a[n]:=2*a[n-1]+2*a[n-2]+a[n-3]; od; a; # _G. C. Greubel_, Jun 27 2019
%K nonn,easy
%O 0,3
%A _N. J. A. Sloane_, Nov 17 2002