OFFSET
0,2
COMMENTS
Partial sums of A080412.
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,1,-2,1).
FORMULA
G.f.: x*(2 - x + 2*x^2 + x^3)/((1 - x)^3*(1 + x + x^2 + x^3)).
a(n) = 2*a(n-1) - a(n-2) + a(n-4) - 2*a(n-5) + a(n-6).
a(n) = (2*n^2 + 2*n + 2*sin((Pi*n)/2) - (-1)^n + 1)/4.
Sum_{n>=1} 1/a(n) = 1.495144413654306177...
EXAMPLE
a(0) = 0;
a(1) = 0 + 2 = 2;
a(2) = 0 + 2 + 1 = 3;
a(3) = 0 + 2 + 1 + 3 = 6;
a(4) = 0 + 2 + 1 + 3 + 4 = 10;
a(5) = 0 + 2 + 1 + 3 + 4 + 6 = 16;
a(6) = 0 + 2 + 1 + 3 + 4 + 6 + 5 = 21;
a(7) = 0 + 2 + 1 + 3 + 4 + 6 + 5 + 7 = 28;
a(8) = 0 + 2 + 1 + 3 + 4 + 6 + 5 + 7 + 8 = 36;
a(9) = 0 + 2 + 1 + 3 + 4 + 6 + 5 + 7 + 8 + 10 = 46, etc.
MATHEMATICA
LinearRecurrence[{2, -1, 0, 1, -2, 1}, {0, 2, 3, 6, 10, 16}, 55]
Table[(2 n^2 + 2 n + 2 Sin[(Pi n)/2] - (-1)^n + 1)/4, {n, 0, 54}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Feb 25 2016
STATUS
approved