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
Paolo Xausa, Table of n, a(n) for n = 1..10000
T. Mansour and M. Schork, Wiener, hyper-Wiener, detour and hyper-detour indices of bridge and chain graphs, J. Math. Chemistry, 47, 2010, 72-98 (see Example 5.6).
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
a(n) = n*(2 + 3*n + 3*n^2).
G.f.: 2*z*(2 + z)^2/(1 - z)^4.
a(n) = Sum_{k=1..2*n} k*A143942(n,k).
From Enrique Navarrete, Feb 25 2026: (Start)
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
E.g.f.: exp(x)*(3*x^3 + 12*x^2 + 8*x). (End)
EXAMPLE
a(1)=8 because in the graph <> with vertices a,b,c,d we have 4 distances equal to 1 (the edges) and 2 distances equal to 2 (ac and bd); 4*1 + 2*2 = 8.
MAPLE
seq(n*(2+3*n+3*n^2), n=1..40);
MATHEMATICA
LinearRecurrence[{4, -6, 4, -1}, {8, 40, 114, 248}, 50] (* Paolo Xausa, Mar 30 2026 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Sep 06 2008
STATUS
approved
