OFFSET
3,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 3..1000
Index entries for linear recurrences with constant coefficients, signature (3,0,-8,6,6,-8,0,3,-1).
FORMULA
a(n) = 6*a(n-1)-15*a(n-2)+20*a(n-3)-15*a(n-4)+6*a(n-5)-a(n-6) -4*(2*n^2-22*n+63)*(-1)^n, with n>8, a(3)=2, a(4)=14, a(5)=66, a(6)=198, a(7)=508, a(8)=1092.
From Bruno Berselli, May 29 2013: (Start)
G.f.: 2*x^3*(1+4*x+12*x^2+8*x^3+7*x^4)/((1+x)^3*(1-x)^6).
a(n) = 3*a(n-1) -8*a(n-3) +6*a(n-4) +6*a(n-5) -8*a(n-6) +3*a(n-8) -a(n-9), with n>11.
a(n) = (n-2)*(n-1)*(8*n^3-16*n^2+6*n-15*(-1)^n+15)/120. (End)
a(n) = (1/4)*(binomial(2*n,5) + 2*binomial(n-1,2)*(1/2)*(1-(-1)^n)). [Yosu Yurramendi and María Merino, Aug 21 2013]
MATHEMATICA
Table[(n - 2) (n - 1) ((8 n^3 - 16 n^2 + 6 n - 15 (-1)^n + 15)/120), {n, 3, 40}] (* Bruno Berselli, May 30 2013 *)
LinearRecurrence[{3, 0, -8, 6, 6, -8, 0, 3, -1}, {2, 14, 66, 198, 508, 1092, 2156, 3876, 6606}, 50] (* T. D. Noe, Jun 14 2013 *)
CoefficientList[Series[2 (1 + 4 x + 12 x^2 + 8 x^3 + 7 x^4) / ((1 + x)^3 (1 - x)^6), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 04 2013 *)
PROG
(Magma) m:=30; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(2*x^3*(1+4*x+12*x^2+8*x^3+7*x^4)/((1+x)^3*(1-x)^6)));
(R) a <- vector()
for(n in 1:40) a[n] <- (1/4)*(choose(2*(n+2), 5) + 2*choose(n+1, 2)*(1/2)*(1-(-1)^n))
a [Yosu Yurramendi and María Merino, Aug 21 2013]
(Magma) [(1/4)*(Binomial(2*n, 5) + 2*Binomial(n-1, 2)*(1/2)*(1-(-1)^n)): n in [3..40]]; // Vincenzo Librandi, Sep 04 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Yosu Yurramendi, May 29 2013
STATUS
approved