OFFSET
1,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
From Ralf Stephan, Mar 13 2003: (Start)
a(n) = (1/2)*(n^3 + 7*n^2 - 46*n + 50), for n>3.
G.f.: x^3*(2 + 13*x - 12*x^2 - x^3 + x^4)/(1-x)^4. (End)
From G. C. Greubel, Jan 01 2024: (Start)
a(n) = (1/2)*(n^3 + 7*n^2 - 46*n + 50) + (-1)^floor((n+2)/2)*binomial(5 -n,2)*[n<4].
E.g.f.: (1/2)*(50 - 38*x + 10*x^2 + x^3)*exp(x) - 25 - 6*x + 3*x^2/2! + x^3/3!. (End)
MAPLE
A075681:=n->1/2*n^3+7/2*n^2-23*n+25: (0, 0, 2, seq(A075681(n), n=4..50)); # Wesley Ivan Hurt, Sep 06 2015
MATHEMATICA
CoefficientList[Series[x^2 (x^4 -x^3 -12 x^2 +13 x +2)/(1-x)^4, {x, 0, 40}], x] (* Vincenzo Librandi, Sep 07 2015 *)
LinearRecurrence[{4, -6, 4, -1}, {0, 0, 2, 21, 60, 121, 207}, 50] (* G. C. Greubel, Jan 03 2024 *)
PROG
(Magma) [0, 0, 2] cat [1/2*n^3+7/2*n^2-23*n+25: n in [4..50]]; // Vincenzo Librandi, Sep 07 2015
(SageMath) [(1/2)*(n^3+7*n^2-46*n+50) +(-1)^((n+2)//2)*binomial(5-n, 2)*int(n<4) for n in range(1, 51)] # G. C. Greubel, Jan 01 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jon Perry, Oct 12 2002
EXTENSIONS
More terms from Ralf Stephan, Mar 13 2003
STATUS
approved