OFFSET
0,2
COMMENTS
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
LINKS
Index entries for linear recurrences with constant coefficients, signature (9,-30,45,-30,9,-1).
FORMULA
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
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
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
MAPLE
S := series(1/(1-3*x+x^2)^3, x = 0, 30): seq(coeff(S, x, j), j = 0 .. 30);
MATHEMATICA
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 *)
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 *)
PROG
(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 */
(PARI) my(x='x+O('x^30)); Vec(1/(1-3*x+x^2)^3) \\ Altug Alkan, Mar 08 2018
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( 1/(1 - 3*x + x^2)^3 )); // Wesley Ivan Hurt, Oct 02 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Aug 23 2014
STATUS
approved