A192023 The Wiener index of the comb-shaped graph |||...|_| with 2n (n>=1) nodes. The Wiener index of a connected graph is the sum of the distances between all unordered pairs of vertices in the graph.
1, 10, 31, 68, 125, 206, 315, 456, 633, 850, 1111, 1420, 1781, 2198, 2675, 3216, 3825, 4506, 5263, 6100, 7021, 8030, 9131, 10328, 11625, 13026, 14535, 16156, 17893, 19750, 21731, 23840, 26081, 28458, 30975, 33636, 36445, 39406, 42523, 45800, 49241, 52850, 56631
Offset: 1
Examples
a(2)=10 because in the graph |_| there are 3 pairs of nodes at distance 1, 2 pairs at distance 2, and 1 pair at distance 3 (3*1 + 2*2 + 1*3 = 10).
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..10000
- Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1)
Crossrefs
Cf. A192022.
Programs
-
Magma
[n*(2*n^2+6*n-5)/3: n in [1..50]]; // Vincenzo Librandi, Jul 04 2011
-
Maple
a := proc (n) options operator: arrow: (1/3)*n*(2*n^2+6*n-5) end proc: seq(a(n), n = 1 .. 43);
Formula
a(n) = n*(2*n^2 + 6*n - 5)/3.
G.f.: -x*(-1 - 6*x + 3*x^2) / (x-1)^4. - R. J. Mathar, Jun 26 2011
Comments