OFFSET
0,4
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
G.f.: x^2*(1 + 2*x + x^2 - x^4)/((1 - x)^3*(1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n > 6.
a(n) = (6*n^2 + 6*n - 23 + (7 - 2*n)*(-1)^n)/16 for n > 1.
a(n) = floor((n+3)/4) * floor((3*n-4)/2) + (floor((n-1)/2) mod 2) * floor((3*n-3)/4) for n > 1.
For n > 1, a(2n) = A095794(n). - Jon E. Schoenfield, Feb 19 2022
EXAMPLE
n | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, ...
__________________________________________
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
+ 0, 0, 0
+ 1, 1, 1, 1,
+ 2, 2, 2, 2, 2
+ 3, 3, 3, 3, 3, 3
+ 4, 4, 4, 4, 4, 4, 4
+ 5, 5, 5, 5, 5, 5, 5, 5
+ 6, 6, 6, 6, 6, 6, 6, 6, 6
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
+ ...
__________________________________________
a(n)|0, 0, 1, 3, 6,10,14,20,25,33,39, ...
MATHEMATICA
CoefficientList[Series[x^2*(1 + 2 x + x^2 - x^4)/((1 - x)^3*(1 + x)^2), {x, 0, 50}], x] (* or *)
LinearRecurrence[{1, 2, -2, -1, 1, 0, 0}, {0, 0, 1, 3, 6, 10, 14}, 60]
PROG
(Magma) [0, 0] cat [(6*n^2+6*n-23+(7-2*n)*(-1)^n)/16 : n in [2..100]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 19 2016
STATUS
approved