I was wondering whether there is any formula that can calculate the number of terms in a cyclic sum:
If $i = 1, \ldots, n$, then for $\sum_{\text{cyc}}x_ix_j$, there are $\frac{n(n-1)}{2}$ terms in the summation.
For example
If $i = 4$, then there are $6$ terms, like, $x_1x_2, x_1x_3, x_1x_4, x_2x_3, x_2x_4, x_3x_4.$ which equals to $ \frac{4\times3}{2} = 6$.
However, is there any formula that can calculate the cases like,
$i = 1, \ldots, n$, $\sum_{\text{cyc}}x_ix_jx_k$
$i = 1, \ldots, n$, $\sum_{\text{cyc}}x_ix_jx_kx_l$
The following are just some thoughts that may help:
For your first summation, we need $i \neq j$ and that the summation cycles through in the manner you described. Notice that since we are counting terms we see that clearly terms of the form $x_{1}x_{j}$, where $j$ is such that $1 \leq j \leq i$.we count $j-1$ distinct terms. Clearly the number possibilities decreases by $1$ as the index of the first term increases by $1$. Recall that $\sum_{k=1}^nk=\frac{n(n+1)}2$ and then set $j-1 = n$ to get the desired formula. For your second summation, we can look at the problem the same way where we fix the first symbol $x_{1}$ and look at the distinct terms possible of $x_{1}x_{j}x_{k}$. By the previous work there are $\frac{j(j-1)}2$ terms of this form. Now if we fix the terms to be of the form $x_{2}x_{j}x_{k}$ we see that there are $\frac{j(j-1)}2 - 4$ if $i = 4$....
I am not sure yet of a general form for how much to subtract off. I am sure there is a combinatorial number to make your problem easy, but I do not know one.