Let $a_1,$ $a_2,$ $\ldots,$ $a_n$ be positive real numbers. Prove that $$\sqrt{\frac{a_1^2+\left( \frac{a_1+a_2}{2}\right)^2+\cdots +\left(\frac{a_1+a_2+\cdots +a_n}{n}\right)^2}{n}} \le \frac{a_1+\sqrt{\frac{a_1^2+a_2^2}{2}}+\cdots+\sqrt{\frac{a_1^2+a_2^2+\cdots +a_n^2}{n}}}{n}.$$
I have proved this inequality for $n=2$ and $n=3.$ But I still cannot prove it for the general case. Can somone help me?