The question is to calculate, given $n$ a positive integer
$$S_n:=\sum_{k=1}^n\cos\frac{k\pi}{n+1},$$ and
$$P_n:=\prod_{k=1}^n(-2)\cos\frac{k\pi}{n+1}.$$
By the way, if we define the matrix $\mathbf{A}_n=[a_{ij}^n]_{\forall\,i,j}$ as follows:
$$ a_{ij}^n= \begin{cases} 1, \text{ if $i=j+1$ or $j = i+1$}\\ 0, \text{ otherwise} \end{cases}, $$ or simply
$$ \mathbf{A}_n=\begin{bmatrix} 0 & 1 & 0 & \cdots & \cdots & \cdots & 0 \\ 1 & 0 & 1 & \ddots & & & \vdots\\ 0 & 1 & 0 & \ddots & \ddots & & \vdots \\ \vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\ \vdots & & \ddots & \ddots & 0 & 1 & 0 \\ \vdots & & & \ddots & 1 & 0 & 1 \\ 0 & \cdots & \cdots & \cdots & 0 & 1 & 0 \\ \end{bmatrix},$$
then one can show that
$$S_n=\operatorname{tr}(\mathbf{A}_n),\tag{E1}$$
and
$$P_n=\det(\mathbf{A}_n).\tag{E2}$$
Is it easy to find the determinant of $\mathbf{A}_n$?
Without proving $(E1)$ and $(E2)$, I can say that
- $S_n=0$ for all $n$; and
- if $n$ is odd then $P_n=0$
- if $n$ is even then $P_n=\ldots$.
