OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (6,-14,16,-9,2).
FORMULA
G.f.: x*(1-3*x+3*x^2)/((1-2*x)*(x-1)^4). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 14 2009; corrected by R. J. Mathar, Sep 16 2009
a(n) = 6*a(n-1) - 14*a(n-2) + 16*a(n-3) - 9*a(n-4) + 2*a(n-5) for n > 4. - Vincenzo Librandi, Mar 15 2014
a(n) = -2 + 2^(1+n) - (5*n)/6 - n^3/6. - Colin Barker, Jul 21 2017
EXAMPLE
a(4) = 16 = sums of 4th row terms of A126277: (1 + 4 + 7 + 4).
a(4) = 16 = 1*1 + 3*2 + 3*2 + 1*3.
MATHEMATICA
CoefficientList[Series[(1 - 3 x + 3 x^2)/((1 - 2 x) (x - 1)^4), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 15 2014 *)
PROG
(PARI) Vec(x*(1-3*x+3*x^2)/((1-2*x)*(x-1)^4) + O(x^100)) \\ Colin Barker, Mar 13 2014
(Magma) I:=[1, 3, 7, 16, 37]; [n le 5 select I[n] else 6*Self(n-1)-14*Self(n-2)+16*Self(n-3)-9*Self(n-4)+2*Self(n-5): n in [1..40]]; // Vincenzo Librandi, Mar 15 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson, Dec 23 2006
EXTENSIONS
More terms from Colin Barker, Mar 13 2014
STATUS
approved