OFFSET
3,2
LINKS
Colin Barker, Table of n, a(n) for n = 3..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1)
FORMULA
G.f.: x^3*(1+4*x+9*x^2+5*x^3+8*x^4) / ((1-x)^4*(1+x)^3). - Emeric Deutsch, Feb 18 2004
From Colin Barker, Jan 29 2016: (Start)
a(n) = (18*n^3-9*(-1)^n*n^2-111*n^2+53*(-1)^n*n+243*n-75*(-1)^n-181)/32.
a(n) = (9*n^3-60*n^2+148*n-128)/16 for n even.
a(n) = (9*n^3-51*n^2+95*n-53)/16 for n odd.
(End)
MATHEMATICA
t[n_, 0] := 1; t[n_, n_] := 1; t[n_, k_] := t[n, k] = Which[EvenQ@ n, t[n - 1, k - 1] + t[n - 1, k], OddQ@ n, t[n - 1, k - 1] + t[n - 1, k] + t[n - 2, k - 1]]; Table[t[n, n - 3], {n, 3, 45}] (* Michael De Vlieger, Jan 29 2016, after Clark Kimberling at A026386 *)
PROG
(PARI) Vec(x^3*(1+4*x+9*x^2+5*x^3+8*x^4)/((1-x)^4*(1+x)^3) + O(x^100)) \\ Colin Barker, Jan 29 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved