OFFSET
1,2
LINKS
Indranil Ghosh, Rows 1..100, flattened
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, Wiener Index
FORMULA
T(n,k) = n*k + n*(n-1) + k*(k-1).
G.f.: x*y*(x+y+2*x*y^2+2*x^2*y-7*x*y+1)/((1-x)^3*(1-y)^3). - R. J. Mathar, Nov 27 2015
EXAMPLE
Triangle of terms:
1
4 8
9 14 21
16 22 30 40
25 32 41 52 65
36 44 54 66 80 96
T(2,1)=4. Indeed, K(2,1) is the graph in the shape of a V and the Wiener index is 2*1 + 2 = 4. - Emeric Deutsch, Aug 25 2013
MAPLE
Wi := proc (m, n) options operator, arrow: (m+n)^2-m*n-m-n end proc: for m to 10 do seq(Wi(m, n), n = 1 .. m) end do; # yields sequence in triangular form; Emeric Deutsch, Aug 25 2013
MATHEMATICA
Table[Table[3n^2-2*n+(m-n)3n + 2*Binomial[m-n, 2], {n, 1, m}], {m, 1, 20}]//Grid
(* Second program *)
Table[SeriesCoefficient[x y (x + y + 2 x y^2 + 2 x^2*y - 7 x y + 1)/((1 - x)^3*(1 - y)^3), {x, 0, n}, {y, 0, k}], {n, 11}, {k, n}] // Flatten (* Michael De Vlieger, Feb 24 2017 *)
PROG
(Python)
i=1
for n in range(1, 101):
....for k in range(1, n+1):
........print str(i)+" "+str(n*k + n*(n-1) + k*(k-1))
........i+=1 # Indranil Ghosh, Feb 24 2017
CROSSREFS
KEYWORD
AUTHOR
Geoffrey Critzer, Patrick Cuddy, May 02 2012
STATUS
approved