OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
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, Grid Graph.
FORMULA
a(n) = (1/2)*n*(n+3)*(3n-1).
G.f.: z*(4+9*z-4*z^2)/(1-z)^4.
a(n) = Sum_{k=1..n+1} k*A180568(n,k). - corrected by Andrew Howroyd, May 27 2017
EXAMPLE
a(1)=4 because in P_3 X P_1 = P_3 there are 2 pairs of nodes at distance 1 and one pair at distance 2.
MAPLE
seq((1/2)*n*(n+3)*(3*n-1), n = 1 .. 40);
MATHEMATICA
Table[n (n + 3) (3 n - 1)/2, {n, 39}] (* or *)
Rest@ CoefficientList[Series[x (4 + 9 x - 4 x^2)/(1 - x)^4, {x, 0, 39}], x] (* Michael De Vlieger, May 28 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Sep 28 2010
STATUS
approved