OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,-2,-8,7,4,-4).
FORMULA
G.f.: (1-x-x^3+3*x^4-5*x^5-2*x^6+3*x^7)/((1-x)^2*(1+x)^2*(1-2*x)^2). - Colin Barker, Apr 26 2015
From G. C. Greubel, Jun 23 2024: (Start)
a(n) = (1/6)*(n+2)*(17*2^(n-2) - 3 + (-1)^n) + (1/4)*([n=0] + 3*[n=1]).
a(n) = ( n*(n+2)*a(n-1) + 2*(n+1)*(n+2)*a(n-2) + n*(n+1)*(n+2) )/(n*(n + 1)), with a(0) = 1, a(1) = 3, a(2) = 10, a(3) = 25.
E.g.f.: (1/12)*( 17*(1+x)*exp(2*x) - 6*(2+x)*exp(x) + 2*(2-x)*exp(-x) + 3*(1+3*x) ). (End)
MATHEMATICA
Table[(n+2)*(17*2^(n-2) -3 +(-1)^n)/6 +(1/4)*(Boole[n==0] +3*Boole[n== 1]), {n, 0, 50}] (* G. C. Greubel, Jun 23 2024 *)
PROG
(Magma) [n le 1 select 2*n+1 else (n+2)*(17*2^(n-2) -3 +(-1)^n)/6: n in [0..40]]; // G. C. Greubel, Jun 23 2024
(SageMath) [(n+2)*(17*2^(n-2) -3 +(-1)^n)/6 + (1/4)*(int(n==0) + 3*int(n==1)) for n in range(41)] # G. C. Greubel, Jun 23 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved