OFFSET
1,1
COMMENTS
The Wiener index of a connected graph is the sum of distances between all unordered pairs of vertices in the graph.
LINKS
B. E. Sagan, Y-N. Yeh, and P. Zhang, The Wiener Polynomial of a Graph, Internat. J. of Quantum Chem., 60, 1996, 959-969.
Eric Weisstein's World of Mathematics, Banana Tree.
FORMULA
EXAMPLE
T(1,2)=4 because the banana tree B(1,2) reduces to a path on 3 nodes, where the distances are 1, 1, and 2.
Square array T(n,k) begins:
4,10,18,28,40,54,70;
20,56,108,176,260,360,476;
48,138,270,444,660,918,1218;
88,256,504,832,1240,1728,2296;
MAPLE
T := proc (n, k) options operator, arrow: n*(k-1)*(3*n*k-2*k+2) end proc: for n to 10 do seq(T(n+2-j, j), j = 2 .. n+1) end do; # yields sequence in triangular form
MATHEMATICA
T[n_, k_] := n*(k - 1)*(3*n*k - 2*k + 2);
Table[T[n - k + 2, k], {n, 1, 10}, {k, 2, n + 1}] // Flatten (* Jean-François Alcover, Aug 26 2024 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Emeric Deutsch, Sep 24 2010
STATUS
approved