Find the integers $n\geq 2$ that satisfy $0 \leq 1 +\frac{n}{n-1}\cos\big(\pi\cdot\frac{n}{n+1}\big)$ I want to find the integers $n\geq 2$ that satisfy the inequality
$$
x_1x_2+x_2x_3+\cdots+x_{n-1}x_n\leq\frac{n-1}{n}\Big(x_1^2+x_2^2+\cdots+x_n^2\Big)
$$
for all $x_i>0$.
I see that if $n=2$, the geometric mean and quadratic mean inequality
$$
\sqrt{x_1x_2}\leq\sqrt{\frac{x_1^2+x_2^2}{2}}
$$
solve this question, but if $n>2$, the problem is difficult. I see inequality that solve it with a positive semidefinite quadratic form. But this lead to the former inequality, I see $n=2$ satisfies that inequality but, for example, $n=3$, $n=5$ not. I suspect that $n=2$ is the only solution but I don't see how to prove it.
 A: Suppose the inequality is true for some $n\in\mathbb N,\ n> 1$. For $n=2$, we know the inequality is true. We show that for $n\ge 3$, there are counterexamples to the inequality.
To that end, first let $n=3$ and $x_1=2,\ x_2=3,\ x_3=2$. Then if the inequality is satisfied, we have $$x_1x_2+x_2x_3\le \frac{3-1}{3}(x_1^2+x_2^2+x_3^2)\Rightarrow 3(6+6)\le 2(4+9+4)\Rightarrow 36\le 34$$
which is a contradiction. Thus the inequality does not work for $n=3$.
Now, say it holds for some $n>3$. Then let $x_1=1/2,\ x_j=1$ for $2\le j\le n$. Then again, if the inequality is satisfied, we must have
\begin{align*}
\sum_{j=1}^{n-1} x_{j}x_{j+1}\le \frac{n-1}{n}\sum_{j=1}^n x_j^2&\Rightarrow \frac12+(n-2)\le \frac{n-1}{n}\left(\frac14+(n-1)\right)=\frac{n-1}{n}\left(n-\frac34\right)\\
&\Rightarrow n\left(n-\frac32\right)\le (n-1)\left(n-\frac34\right)\\
&\Rightarrow n^2-\frac{3n}{2}\le n^2-\frac{7n}{4}+\frac34\\
&\Rightarrow \frac{n}{4}\le \frac34\\
&\Rightarrow n\le 3
\end{align*}
which is again a contradiction.
Thus the inequality only holds for $n=2$.
A: Though you have already got a perfect answer I will post this one based on your initial approach because trying to apply it I have invented a new (for me) method to prove a functional inequality which may be useful for somebody else as well.
Introducing $x=\frac1{n+1}$ the statement
"$n=2$ is the only solution for $n\ge2$"
is a simple corollary of the inequality:
$$
\cos\pi x> \frac{1-2x}{1-x}=2-\frac1{1-x},\quad\forall x: 0< x< \frac13.\tag1
$$
This inequality is in turn a simple corollary of the following lemma:

The equation  $$ \cos\pi x=2-\frac1{1-x}\tag2$$ has exactly three roots on the interval $\left[0,\frac12\right]$: $x=0,\frac13,\frac12$.

In fact the above three numbers are the only roots of the equation $(2)$ on the whole real axis, but we do not need this for our task (it is however trivial to show that the equation has no roots outside the interval).
Consider the function
$$
f(x)=\cos\pi x+\frac1{1-x}-2.\tag3
$$
Differentiating it twice over $x$, we have:
$$
f''(x)=-\underbrace{\pi^2\cos\pi x\vphantom{\frac1{)^2}}}_{g(x)}+\underbrace{\frac2{(1-x)^3}}_{h(x)}.
$$
One easily observes that the equation $f''(x)=0 \iff g (x)=h (x)$ has a single solution in the interval $\left[0,\frac12\right]$ since:
a) $g(x)$ is continuous and decreasing;
b) $h(x)$ is continuous and increasing;
c) $g(0)>h(0)$ and $g\left(\frac12\right)<h\left(\frac12\right)$.
This implies that $f'(x)$ has no more than two roots which in turn implies that $f(x)$ has no more than three roots on the investigated interval. But by direct substitution we know that $x=0,\frac13,\frac12$ are the roots of the equation $(2)$, so the lemma is proved.
