OFFSET
0,2
FORMULA
a(n) = P(n, n-2, n) where P(n, m, z) = Product_{j=0..n-1} (z - Sum_{k=1..m} e^(j*k*2*Pi*I/n)), I=sqrt(-1).
MAPLE
seq(0^n + 2*((n+1)^n-(-1)^n)/(n+2), n=0..20); # Georg Fischer, May 08 2021
MATHEMATICA
P[n_, m_, z_]:= Product[z - Sum[E^(j*k*2*pi*I/n), {k, 1, m}], {j, 0, n-1}];
Table[FullSimplify[P[n, n-2, n]], {n, 0, 12}] (* Georg Fischer, May 08 2021 *)
PROG
(PARI) a(n) = 0^n + 2*((n+1)^n - (-1)^n) / (n+2); \\ Michel Marcus, May 09 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Feb 03 2004
STATUS
approved