How to prove this inequality $\frac{a_{1}a_{2}+a_{2}a_{3}+\cdots+a_{n-1}a_{n}}{a^2_{1}+a^2_{2}+\cdots+a^2_{n}}\le\cos{\frac{\pi}{n+1}}$ 
Let $a_{1},a_{2},\cdots,a_{n},n\ge 2$ be real numbers,show that
  $$\dfrac{a_{1}a_{2}+a_{2}a_{3}+\cdots+a_{n-1}a_{n}}{a^2_{1}+a^2_{2}+\cdots+a^2_{n}}\le\cos{\dfrac{\pi}{n+1}}$$

I think this result is interesting.
When $n=2$, clearly
$$\dfrac{a_{1}a_{2}}{a^2_{1}+a^2_{2}}\le\dfrac{1}{2}=\cos{\dfrac{\pi}{3}}=\dfrac{1}{2}$$
When $n=3$,
$$\dfrac{a_{1}a_{2}+a_{2}a_{3}}{a^2_{1}+a^2_{2}+a^2_{3}}\le\dfrac{\sqrt{2}}{2}.$$
This is true, because
$$a^2_{1}+\dfrac{1}{2}a^2_{2}\ge \sqrt{2}a_{1}a_{2},$$
$$\dfrac{1}{2}a^2_{2}+a^2_{3}\ge\sqrt{2}a_{2}a_{3}.$$
But for general $n$ I cannot prove it. 
 A: I don't get the result you are looking for, a mistake may have crept in somewhere, I'll get back tot he question tomorrow morning. What I try to do is to find the spectrum of the matrix $D_n$ defined below. The solution uses the Tchebychev polynomials.
Edit. I made a mistake when identifying (the rescaled version of) the $\chi_n$ with the Tchebychew polynomials: the second polynomial $\tau_2=\frac12\chi_2(-2X)$ is actually equal to $2X^2-\frac12$ and not $T_2=2X^2-1$. I'm not sure I can rescue the proof.

Consider the real symmetric matrix
$$D_n=\begin{pmatrix}
0&1\\
1&0&1\\
 &1&0\\
&&&\ddots\\
&&&&0&1\\
&&&&1&0
\end{pmatrix}$$
Then the equation above is equivalent to 
$$\langle D_nX\,|\,X\rangle\leq2|X|^2\cos\left(\frac{\pi}{n+1}\right)$$
for all nonzero vectors $X\in\mathbb{R}^{n}$, where $|X|^2=\langle X\,|\,X\rangle$. Because $D_n$ is diagonalizable in an orthonormal basis, it is enough to show that all the eigenvalues of $D_n$ are of absolute value less or equal than $2\cos\left(\frac{\pi}{n+1}\right)$.

The characteristic polynomial $\chi_n(X)=\det(D_n-XI)$ of $D_n$ the relations $\chi_1=-X$, $\chi_2=X^2-1$ (and $\chi_3=-X^3+2X$) and an easy manipulation of determinants shows that for all $n\geq 2$, 
$$\chi_n+X\chi_{n-1}+\chi_{n-2}=0$$
Compare this to the linear recursion satisfied by the Tchebychew polynomials of the first (and second) kind :
$$T_n-2XT_{n-1}+T_{n-2}=0$$
The sequence $(\tau_n)=(\frac12\chi_n(-2 X))_n$ satisfies the recursion formula above, and the first two terms agree with the first two Tchebychew polynomials, for
$\tau_1=X=T_1$ and $\tau_2=2X^2-1=T_2$
so that for all $n\geq 0$, $\tau_n=T_n$ and 
$$\chi_n(X)=2T_n\left(-\frac12 X\right)$$
Since the roots of $T_n$ are the $\cos\left(\frac{2k+1}{2n}\pi\right)$ for $k=0,\dots,n-1$, we get the roots of $\chi_n$, i.e.
$$\mathrm{Spec}(D_n)=\left\lbrace 2\cos\left(\frac{2k+1}{2n}\pi\right)\left|\right. k=0,\dots,n-1\right\rbrace$$
And so all eigenvalues are (in abolute value) at most $2\cos\left(\frac{\pi}{2n}\right)$.
A: For $t \in (0,\frac{\pi}{n})$, we have $\sin kt > 0$, for $k \in 1,\cdots,n-1$.
Thus from AM-GM inequality, $\dfrac{\sin (k+1)t}{\sin kt}a_k^2+\dfrac{\sin kt}{\sin (k+1)t}a_{k+1}^2 \ge 2a_ka_{k+1}$,
with equality iff $a_{k+1}\sin kt = a_k\sin (k+1)t$.
Summing over we have, $\displaystyle \sum\limits_{k=1}^{n-1} \left(\dfrac{\sin (k+1)t}{\sin kt}a_k^2+\dfrac{\sin kt}{\sin (k+1)t}a_{k+1}^2\right) \ge 2\sum\limits_{k=1}^{n-1}a_ka_{k+1}$
$\displaystyle \implies 2a_1^2\cos t + \sum\limits_{k=2}^{n} \left(\dfrac{\sin (k-1)t}{\sin kt}+\dfrac{\sin (k+1)t}{\sin kt}\right)a_k^2 \ge \dfrac{\sin (n+1)t}{\sin nt}a_n^2 + 2\sum\limits_{k=1}^{n-1}a_ka_{k+1}$
$\displaystyle \implies 2\cos t\sum\limits_{k=1}^{n}a_k^2 \ge \dfrac{\sin (n+1)t}{\sin nt}a_n^2 + 2\sum\limits_{k=1}^{n-1}a_ka_{k+1}$
Putting, $t = \dfrac{\pi}{n+1}$, $\sin (n+1)t = 0$.
Therefore, $\displaystyle \cos \dfrac{\pi}{n+1}\sum\limits_{k=1}^{n}a_k^2 \ge \sum\limits_{k=1}^{n-1}a_ka_{k+1}$ as desired.
A: Let $M_1 = \dfrac{1}{4\cos\dfrac{\pi}{n+1}}$ and $M_{k+1} = \dfrac{1}{4[\cos\dfrac{\pi}{n+1} - M_k]}$. If we can prove $0 <M_k < \cos\dfrac{\pi}{n+1}$ for $k < n -1$, then we have
\begin{align}
a_1a_2 \leq \cos\dfrac{\pi}{n+1}a_1^2 + M_1 a_2^2 \\
a_2 a_3 \leq (\cos\dfrac{\pi}{n+1} - M_1)a_2^2 + M_2 a_3^2 \\
\vdots \\
a_{n-1}a_n \leq (\cos\dfrac{\pi}{n+1} - M_{n-2})a_{n-1}^2 + M_{n-1}a_n^2
\end{align}
thus all we need to prove is $0 <M_k < \cos\dfrac{\pi}{n+1}$ for all $ k < n-1$ and $M_{n-1} = \cos\dfrac{\pi}{n+1}$ 
To do this, we aim at finding constants $x$ and $y$, such that $\exists c$ with
\begin{align}
\frac{M_{k+1} + x}{M_{k+1} + y} = c \frac{M_{k} + x}{M_{k} + y}
\end{align}
After simplication, we find we can take $x$ and $y$ as different solutions of $$4\lambda^2 + 4\cos\dfrac{\pi}{n+1}\lambda + 1 = 0$$ and $c = \frac{x}{y}$, i.e.:
\begin{align}
x = -\frac{1}{2}(\cos\dfrac{\pi}{n+1} + i \sin\dfrac{\pi}{n+1})= -\frac{1}{2}e^{i\theta}\\
y = -\frac{1}{2}(\cos\dfrac{\pi}{n+1} - i \sin\dfrac{\pi}{n+1}) = -\frac{1}{2}e^{-i\theta}\\
c = (\cos\dfrac{\pi}{n+1} + i \sin\dfrac{\pi}{n+1})^2 = e^{i2\theta}
\end{align}
wiht $\theta = \frac{\pi}{n+1}$
Then we have
\begin{align}
\frac{M_{n-1} - \frac{1}{2}e^{i\theta}}{M_{n-1} - \frac{1}{2}e^{-i\theta}} = e^{2(n-2)i\theta} \frac{M_{1} - \frac{1}{2}e^{i\theta}}{M_{1} - \frac{1}{2}e^{-i\theta}}
\end{align}
Since $M_1 = \dfrac{1}{2(e^{i\theta} + e^{-i\theta})}$, we get
\begin{align}
\frac{M_{1} - \frac{1}{2}e^{i\theta}}{M_{1} - \frac{1}{2}e^{-i\theta}} = e^{4i\theta}
\end{align}
Thus
\begin{align}
\frac{M_{n-1} - \frac{1}{2}e^{i\theta}}{M_{n-1} - \frac{1}{2}e^{-i\theta}} = e^{2ni\theta} = e^{-2i\theta}
\end{align}
Then we get easily $M_{n-1} = \dfrac{e^{i\theta} + e^{-i\theta}}{2}=\cos\frac{\pi}{n+1}$
Finally note that  if $M_k < \cos\frac{\pi}{n+1} - \frac{1}{4\cos\frac{\pi}{n+1}}$
$$M_{k+1} - \cos\frac{\pi}{n+1} = \dfrac{1 - 4\cos^2\frac{\pi}{n+1} + 4M_k \cos\frac{\pi}{n+1}}{4(\cos\frac{\pi}{n+1} - M_k)} < 0$$ 
Note also that $M_{k+1} - M_{k} = \dfrac{1 - 4\cos\frac{\pi}{n+1}M_k + 4M_k^2}{4(\cos\frac{\pi}{n+1} - M_k)} > 0$ when $M_k < \cos\frac{\pi}{n+1} $
since we know that $M_{n-2} = \cos\frac{\pi}{n+1} - \frac{1}{4\cos\frac{\pi}{n+1}}$, we can conclude $M_k$ is increasing for $k < n-1$, therefore $0<M_k < \cos\frac{\pi}{n+1}$ for $k < n-1$
A: Here is a derivation using the calculus of variations.
Given that
$$
\sum_{k=1}^na_k^2=1\tag{1}
$$
we want to find the maximum of
$$
\sum_{k=1}^na_ka_{k-1}\tag{2}
$$
where $a_0=a_{n+1}=0$.
We want to find $a_k$ so that $(2)$ is stationary, that is,
$$
\begin{align}
0
&=\sum_{k=1}^na_k\,\delta a_{k-1}+a_{k-1}\,\delta a_k\\
&=\sum_{k=1}^n(a_{k-1}+a_{k+1})\,\delta a_k\tag{3}
\end{align}
$$
for all $\delta a_k$ so that $(1)$ is constant:
$$
0=\sum_{k=1}^na_k\,\delta a_k\tag{4}
$$
For both the $a_{k-1}+a_{k+1}$ in $(3)$ and the $a_k$ in $(4)$ to be perpendicular to all the same $\delta a_k$, we must have some $\lambda$ so that
$$
a_{k+1}+a_{k-1}=\lambda a_k\tag{5}
$$
Solving $(5)$, so that $a_0=a_{n+1}=0$, using the standard methods for linear recurrences yields
$$
a_k=r\sin\left(\frac{\pi mk}{n+1}\right)\tag{6}
$$
for $m\in\mathbb{Z}$.
We can compute $r$ using $(1)$ and $(6)$:
$$
\begin{align}
\sum_{k=1}^na_k^2
&=\sum_{k=1}^nr^2\sin^2\left(\frac{\pi mk}{n+1}\right)\\
&=-\frac{r^2}{4}\sum_{k=1}^n\left[\exp\left(\frac{2\pi imk}{n+1}\right)+\exp\left(\frac{-2\pi imk}{n+1}\right)-2\right]\\
&=-\frac{r^2}{4}(-2n-2)\ \Big[m\not\equiv0\bmod{(n+1)}\Big]\\
&=r^2\frac{n+1}{2}\ \Big[m\not\equiv0\bmod{(n+1)}\Big]\tag{7}
\end{align}
$$
We cannot satisfy $(1)$ when $m\equiv0\bmod{(n+1)}$; therefore, we require $m\not\equiv0\bmod{(n+1)}$, in which case,
$$
r=\sqrt{\dfrac2{n+1}}\tag{8}
$$
Finally, we need to compute $(2)$ for each $m\not\equiv0\bmod{(n+1)}$:
$$
\begin{align}
&\frac2{n+1}\sum_{k=1}^n\sin\left(\frac{\pi mk\vphantom{()}}{n+1}\right)\sin\left(\frac{\pi m(k-1)}{n+1}\right)\\
&=\frac1{n+1}\sum_{k=1}^n\left[\cos\left(\frac{\pi\vphantom{()}m}{n+1}\right)-\cos\left(\frac{\pi m(2k-1)}{n+1}\right)\right]\\
&=\frac{n}{n+1}\cos\left(\frac{\pi m}{n+1}\right)+\frac1{n+1}\cos\left(\frac{\pi m}{n+1}\right)\\
&=\cos\left(\frac{\pi m}{n+1}\right)\tag{9}
\end{align}
$$
The largest that $(9)$ can be if $m\not\equiv0\bmod{(n+1)}$ is $\cos\left(\frac\pi{n+1}\right)$.
Therefore, by homogeneity,
$$
\frac{\displaystyle\sum_{k=1}^na_ka_{k-1}}{\displaystyle\sum_{k=1}^na_k^2}\le\cos\left(\frac\pi{n+1}\right)\tag{10}
$$
