# Prove the inequalities $\frac {-1}2\leq\Sigma_{1\leq i<j\leq n}a_ia_j\leq \frac{(n-1)}2$

Let $a_1,a_2,...,a_n$ be real numbers such that $\Sigma_{i=1}^{n}a_i^2=1$. Prove the inequalities $$\frac {-1}2\leq\Sigma_{1\leq i<j\leq n}a_ia_j\leq \frac{(n-1)}2$$

Since $(a_1+...+a_n)^2=1+\Sigma_{1\leq i<j\leq n}2a_ia_j$ and $(a_1+...+a_n)^2\geq 0$, the left inequality is easy to show. The right inequality is true iff $(a_1+...+a_n)^2\leq n$, which I hope someone can tell me how to verify.

$$\left(\frac{a_1 + \cdots + a_n}{n}\right)^2 \le \frac{a_1^2 + \cdots + a_n^2}{n} = \frac{1}{n}$$
Therefore $(a_1 + \cdots + a_n)^2 \le \frac{n^2}{n} = n$.