Express dissolved multi-summand binominal equation
After dissolving an multi summand binomial equation $$f(x)=(x_0+x_1+x_2+x_3+\ ...)^2$$ I got $n*(n-1)/2$ of these terms:
$$x_0x_1+x_0x_2+x_0x_3+x_1x_2+x_1x_3+x_2x_3+\ ...$$
How do I write them in a summation formula $\sum$ or other equivalent expressions?
Is $$\sum_{i=0}^n x_i*x_{i+1}$$ the correct expression?
I suppose that what you are looking for is $$f=\sum _{i=1}^n x_i^2+2 \sum _{i=1}^n x_i \sum _{j=i+1}^n x_j$$