OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
G.f.: (1 + 6*x + x^2 + 12*x^3 - 2*x^4)/((1 - x)^4*(1 + x)^3).
a(n) = Sum_{k = 0..n} (6*k + (-1)^k +3)*(3*k - (-1)^k*(3*k + 1) + 5)/16.
a(n) = 1 + (n*(6*n^2 + 27*n + 35) - (9*n^2 + 15*n + 2)*(-1)^n + 2)/16.
EXAMPLE
a(0) = 1;
a(1) = 1 + 2*3 = 7;
a(2) = 1 + 2*3 + 4 = 11;
a(3) = 1 + 2*3 + 4 + 5*6 = 41;
a(4) = 1 + 2*3 + 4 + 5*6 + 7 = 48;
a(5) = 1 + 2*3 + 4 + 5*6 + 7 + 8*9 = 120;
a(6) = 1 + 2*3 + 4 + 5*6 + 7 + 8*9 + 10 = 130;
a(7) = 1 + 2*3 + 4 + 5*6 + 7 + 8*9 + 10 + 11*12= 262;
a(8) = 1 + 2*3 + 4 + 5*6 + 7 + 8*9 + 10 + 11*12 + 13 = 275;
a(9) = 1 + 2*3 + 4 + 5*6 + 7 + 8*9 + 10 + 11*12 + 13 + 14*15 = 485, etc.
MATHEMATICA
Table[Sum[(6 k + (-1)^k + 3) ((3 k - (-1)^k (3 k + 1) + 5)/16), {k, 0, n}], {n, 0, 42}]
Table[1 + (n (6 n^2 + 27 n + 35) - (9 n^2 + 15 n + 2) (-1)^n + 2)/16, {n, 0, 42}]
LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {1, 7, 11, 41, 48, 120, 130}, 43]
PROG
(PARI) Vec((1 + 6*x + x^2 + 12*x^3 - 2*x^4)/((1 - x)^4*(1 + x)^3) + O(x^50)) \\ Michel Marcus, Feb 21 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Feb 21 2016
STATUS
approved