OFFSET
3,3
LINKS
Eric Weisstein, Regular Polygon Division by Diagonals (MathWorld).
Index entries for linear recurrences with constant coefficients, signature (3,-1,-5,5,1,-3,1).
FORMULA
a(n) = 1/8*n*(n^3-11*n^2+43*n-58) for n even;
a(n) = 1/8*n*(n-3)*(n^2-8*n+19) for n odd.
G.f.: x^4*(2*x^5-3*x^4-7*x^3-x^2-2*x-1) / ((x-1)^5*(x+1)^2). [Colin Barker, Feb 14 2013]
MAPLE
a:=n->piecewise(n mod 2 = 0, 1/8*n*(n^3-11*n^2+43*n-58), n mod 2 = 1, 1/8*n*(n-3)*(n^2-8*n+19), 0);
MATHEMATICA
Drop[CoefficientList[Series[x^4(2x^5-3x^4-7x^3-x^2-2x-1)/((x-1)^5(x+1)^2), {x, 0, 50}], x], 3] (* or *) LinearRecurrence[{3, -1, -5, 5, 1, -3, 1}, {0, 1, 5, 15, 42, 94, 189}, 50] (* Harvey P. Dale, Dec 03 2022 *)
PROG
(Python)
def A211380(n): return n*(n*(n*(n-11)+43)-58+(n&1))>>3 # Chai Wah Wu, Nov 22 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Martin Renner, Feb 07 2013
STATUS
approved