OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (3,-3,2,-1).
FORMULA
a(n) = 1+2*Sum_{k=1..n} Sum_{j=0..(n-k)/2} binomial(k+1,j)*binomial(n-k-j-1,n-k-2*j), a(1)=2.
MATHEMATICA
CoefficientList[Series[(x^5 - 2 x^4 + 2 x^3 - x + 1)/(x^4 - 2 x^3 + 3 x^2 - 3 x + 1), {x, 0, 34}], x] (* or *)
Table[If[n == 1, 2, 2 (Sum[Sum[Binomial[k + 1, j] Binomial[n - k - j - 1, n - k - 2 j], {j, 0, (n - k)/2}], {k, n}]) + 1], {n, 0, 34}] (* Michael De Vlieger, Apr 15 2016 *)
LinearRecurrence[{3, -3, 2, -1}, {1, 2, 3, 7, 13, 23}, 40] (* Harvey P. Dale, Oct 20 2023 *)
PROG
(Maxima)
a(n):=if n=1 then 2 else 2*(sum(sum(binomial(k+1, j)*binomial(n-k-j-1, n-k-2*j), j, 0, (n-k)/2), k, 1, n))+1;
(PARI) x='x+O('x^99); Vec((x^5-2*x^4+2*x^3-x+1)/(x^4-2*x^3+3*x^2-3*x+1)) \\ Altug Alkan, Apr 15 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vladimir Kruchinin, Apr 15 2016
STATUS
approved