%I #48 Sep 08 2022 08:46:09
%S 1,9,51,234,951,3573,12707,43398,143682,464148,1469778,4578102,
%T 14063653,42695127,128301453,382144446,1129360689,3314619171,
%U 9668400839,28045947996,80949547380,232589050920,665532883380,1897176603420,5389368930505,15260830474869,43085718922071,121310066722194,340684392838971,954497114903169
%N Expansion of 1/(1 - 3*x + x^2)^3.
%C a(n) is the number of words of length n + 4 over the alphabet {0,1,2} which contain the subword 01 exactly twice. - _Leidy Espitia_, Sep 10 2020
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (9,-30,45,-30,9,-1).
%F a(n) = (2*(25 + 39*n + 20*n^2)*F(2*n+1) + (38 + 51*n + 25*n^2)*F(2*n))/50, where F = A000045. - _Emanuele Munarini_, Mar 08 2018
%F a(n) = Sum_{t=0..n} Sum_{i=0..n-t} f(i)*f(t)*f(n-i-t), where f(n) = Fibonacci(2*n+2) = A001906(n+1). - _Leidy Espitia_, Sep 10 2020
%F a(n) = 9*a(n-1) - 30*a(n-2) + 45*a(n-3) - 30*a(n-4) + 9*a(n-5) - a(n-6). - _Wesley Ivan Hurt_, Sep 30 2020
%p S := series(1/(1-3*x+x^2)^3, x = 0, 30): seq(coeff(S, x, j), j = 0 .. 30);
%t Table[(2 (25 + 39 n + 20 n^2) Fibonacci[2n+1] + (38 + 51 n + 25 n^2) Fibonacci[2n])/50, {n, 0, 24}] (* _Emanuele Munarini_, Mar 08 2018 *)
%t CoefficientList[Series[1/(1-3x+x^2)^3,{x,0,50}],x] (* or *) LinearRecurrence[ {9,-30,45,-30,9,-1},{1,9,51,234,951,3573},50] (* _Harvey P. Dale_, Jan 16 2022 *)
%o (Maxima) makelist(((38+51*n+25*n^2)*fib(2*n)+2*(25+39*n+20*n^2)*fib(1+2*n))/50, n, 0, 30); /* _Emanuele Munarini_, Mar 08 2018 */
%o (PARI) my(x='x+O('x^30)); Vec(1/(1-3*x+x^2)^3) \\ _Altug Alkan_, Mar 08 2018
%o (Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( 1/(1 - 3*x + x^2)^3 )); // _Wesley Ivan Hurt_, Oct 02 2020
%Y Cf. A000045, A001906, A001871.
%K nonn,easy
%O 0,2
%A _Emeric Deutsch_, Aug 23 2014
|