%I #24 Nov 11 2024 20:30:46
%S 0,0,5,27,99,307,867,2307,5891,14595,35331,83971,196611,454659,
%T 1040387,2359299,5308419,11862019,26345475,58195971,127926275,
%U 279969795,610271235,1325400067,2868903939,6190792707,13321109507,28588376067,61203283971,130728067075,278636003331,592705486851,1258425417731
%N a(n) = (n^2/8+3*n/8-2)*2^n + 3.
%H Vincenzo Librandi, <a href="/A226315/b226315.txt">Table of n, a(n) for n = 1..1000</a>
%H W. Y. C. Chen, A. Y. L. Dai and R. D. P. Zhou, <a href="http://arxiv.org/abs/1304.3187">Ordered Partitions Avoiding a Permutation of Length 3</a>, arXiv preprint arXiv:1304.3187, 2013. See Th. 1.1.
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (7,-18,20,-8).
%F G.f.: x^3*(5-8*x)/((1-x)*(1-2*x)^3). - _Bruno Berselli_, Jun 17 2013
%t Table[(n^2 / 8 + 3 n / 8 - 2) 2^n + 3, {n, 40}] (* or *) CoefficientList[Series[x^2 (5 - 8 x) / ((1 - x) (1 - 2 x)^3), {x, 0, 40}], x] (* _Vincenzo Librandi_, Jun 18 2013 *)
%t LinearRecurrence[{7,-18,20,-8},{0,0,5,27},40] (* _Harvey P. Dale_, Jul 10 2018 *)
%o (Magma) [(n^2/8+3*n/8-2)*2^n+3: n in [1..35]]; // _Vincenzo Librandi_, Jun 18 2013
%o (Magma) I:=[0,0,5,27]; [n le 4 select I[n] else 7*Self(n-1)-18*Self(n-2)+20*Self(n-3)-8*Self(n-4): n in [1..40]]; // _Vincenzo Librandi_, Jun 18 2013
%K nonn,easy,changed
%O 1,3
%A _N. J. A. Sloane_, Jun 09 2013