An identity that comes from computing the Wiener index of a cyclic graph Can the below identity be proven in such a way that we can generalize it?
$(1 + 1 + 2 + 2 + 3 + 3 + 4) +( 1 + 2 + 2 + 3 + 3 + 4) + (1 + 2 + 3 + 3 + 4)+ +( 1 + 2 + 3 + 4 )+(1 + 2 + 3) + (1 + 2) + 1 = {4^3}$
This comes from computing the Wiener index for the cyclic graph with $8$ vertices.
 A: Note that you can calculate the Weiner index of the 2n-gon as
$\dfrac 12\cdot 2n\left(2\cdot1+2\cdot2+\cdots+2\cdot (n-1)+n\right)$
A: Assuming that I have understood the question correctly (hard to say), we are computing the Wiener index $W(G)$ of a cyclic graph $G=C_8$. The Wiener index for a graph over $n$ nodes is defined as:
$$ W = \frac{1}{2}\sum_{i=1}^{n}\sum_{j=1}^{n} d_{ij}=\sum_{i<j}d_{ij} $$
where $d_{ij}$ is the graph distance between vertex $i$ and vertex $j$. For a cyclic graph over $n$ vertices, with the trivial labelling, we have $d_{ij}=\min\left(|i-j|,n-|i-j|\right)$, and the given sum computes $W$ by summing the contributes given by the vertices. Obviously, we can compute $W$ also by counting how many couples of vertices are within a given distance, running from $1$ to the diameter of $G$. In $C_{2n}$, the number of such couples is always the same, $2n$, unless the distance equals the diameter (in such a case there are only $n$ couples). This gives:
$$ W(C_{2n})=-n^2+\sum_{d=1}^{n}2nd = n^3.$$ 
