OFFSET
0,1
COMMENTS
This is A118825(n+5), n >= 0. (The g.f. given there is not quite correct, because then a(0) = 0 but it should be 1.)
This sequence a(n), n >= 2, is product(2*cos((2*l+1)*Pi/2), l=0..floor((n-2)/2)). This is the unrestricted product which appears in the formula for C(n, 0) with the minimal polynomial C of rho(n):=2*cos(Pi/n) (see A187360), the length ratio (smallest diagonal)/side in the regular n-gon. The restriction gcd(2*l+1, n) = 1 is ineffective for n = 2^k, k>=1, and for n = odd prime p. Therefore norm(rho(n)) = (-1)^delta(n)*C(n, 0) with delta(n) (see A055034) the degree of C, can be computed from the present sequence for these two cases.
LINKS
Muniru A Asiru, Table of n, a(n) for n = 0..2000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,-1).
FORMULA
O.g.f.: (2 + x + x^3) / (1 + x^4).
a(n) = 2*(-1)^(n/4) if n == 0 (mod 4); a(n) == 0 if n == 2 (mod 4); a(n) = (-1)^((n-1)/4) if n == 1 (mod 4); a(n) == (-1)^((n-3)/4) if n == 3 (mod 4).
a(n) = Product_{l=0..floor((n-2)/2)} 2*cos((2*l+1)*Pi/2). Proof via the product formulas for the four (mod 4) cases; see the comments for subsequences like A033999, and the product of the zeros of Chebyshev S-polynomials (A049310) from S(n-1, 0) which is known.
a(n) = sqrt((n+2)^2 mod 8)*(-1)^floor(n/4). - Wesley Ivan Hurt, Jan 01 2014
a(n) = (cos(Pi*(2*n+q-r-s)/8)-cos(Pi*(-2*n+q+r-s)/8)+sin(Pi*(-2*n+q-r+s)/8)+3*sin(Pi*(2*n+q+r+s)/8))/2 where q = 1+(-1)^n, r = 2*sin(n*Pi/2) and s = 2*cos(n*Pi/2). - Wesley Ivan Hurt, Oct 06 2018
MAPLE
A230075:=n->sqrt((n+2)^2 mod 8)*(-1)^floor(n/4); seq(A230075(n), n=0..100); # Wesley Ivan Hurt, Jan 01 2014
MATHEMATICA
Table[Sqrt[Mod[(n+2)^2, 8]](-1)^Floor[n/4], {n, 0, 100}] (* Wesley Ivan Hurt, Jan 01 2014 *)
PROG
(PARI) a(n)=[2, 1, 0, 1, -2, -1, 0, -1][n%8+1] \\ Charles R Greathouse IV, Jul 17 2016
(GAP) Flat(List([1..15], n->[2, 1, 0, 1, -2, -1, 0, -1])); # Muniru A Asiru, Oct 07 2018
(Magma) &cat [[2, 1, 0, 1, -2, -1, 0, -1]^^20]; // Wesley Ivan Hurt, Oct 10 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Wolfdieter Lang, Oct 23 2013
STATUS
approved