OFFSET
1,1
COMMENTS
The Wiener index of a connected graph G is the sum of distances between all pairs of vertices in G.
The second Maple program finds and sums all the binomial(24,2) distances.
LINKS
Bo-Yin Yang and Yeong-Nan Yeh, A Crowning Moment for Wiener Indices, Studies in Appl. Math., 112 (2004), 333-340.
Index entries for linear recurrences with constant coefficients, signature (6, -15, 20, -15, 6, -1).
FORMULA
a(n) = n(164n^4-30n^2+1)/5.
G.f.: 3x(9+280x+734x^2+280x^3+9x^4)/(1-x)^6. [R. J. Mathar, Sep 05 2008]
EXAMPLE
a(1)=27 because in the hexagon ABCDEF the binomial(6,2)=15 distances are AB=BC=CD=DE=EF=FA=1, AC=BD=CE=DF=EA=FB=2, AD=BE=CF=3 and their sum is 27.
MAPLE
W:=proc(n) options operator, arrow: (164/5)*n^5-6*n^3+(1/5)*n end proc; seq(W(n), n=1..25);
with(GraphTheory); G := Graph([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], {{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 7}, {7, 8}, {8, 9}, {9, 10}, {10, 11}, {11, 12}, {12, 13}, {13, 14}, {14, 15}, {15, 16}, {16, 17}, {17, 18}, {1, 18}, {2, 19}, {5, 20}, {8, 21}, {11, 22}, {14, 23}, {17, 24}, {19, 20}, {20, 21}, {21, 22}, {22, 23}, {23, 24}, {19, 24}}); d := AllPairsDistance(G); with(LinearAlgebra); n := 24; add(add(d[i, j], j = i .. n), i = 1 .. n);
MATHEMATICA
Table[n (164n^4-30n^2+1)/5, {n, 30}] (* or *) LinearRecurrence[{6, -15, 20, -15, 6, -1}, {27, 1002, 7809, 33204, 101751, 253758}, 30] (* Harvey P. Dale, Jun 09 2024 *)
PROG
(PARI) a(n) = n*(164*n^4-30*n^2+1)/5; \\ Michel Marcus, Jan 17 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Sep 04 2008
STATUS
approved