Square of the sum of n positive numbers I have a following problem
When we want to write $a^2 + b^2$ in terms of $(a \pm b)^2$ we can do it like that
$$a^2 +b^2 = \frac{(a+b)^2}{2} + \frac{(a-b)^2}{2}.$$
Can we do anything similar for $a_1^2 + a_2^2 + \ldots + a_n^2$ ?
I can add the assumption that all $a_i$ are positive numbers.
I mean to express this as combination of their sums and differences.
I know that this question is a little bit naive but I'm curious whether it has an easy answer.

Yes. You have to sum over all of the possibilities of $a\pm b\pm c$:
$$4(a^2+b^2+c^2)=(a+b+c)^2+(a+b-c)^2+(a-b+c)^2+(a-b-c)^2$$
This can be extended to n factors by:
$$\sum_{k=1}^n a_k^2=\sum_{\alpha=(1,-1,...,-1)\; |a_i|=1}^{(1,...,1)}\frac{\big(\sum_{i=1}^{n}\alpha_ia_i\big)^2}{2^{n-1}}$$
($\alpha$ is a multiindex with values that are either -1 or 1, except the first that is always 1)
