OFFSET
1,3
LINKS
B. E. Sagan, Y-N. Yeh and P. Zhang, The Wiener Polynomial of a Graph, Internat. J. of Quantum Chem., 60, 1996, 959-969.
FORMULA
T(p,q) = pq(p+q)(pq - 1)/8 if both p and q are odd.
T(p,q) = p^2*q^2*(p + q)/8 if both p and q are even.
T(p,q) = pq^2*(p^2 - 1 + pq)/8 if p is odd and q is even.
T(p,q) = p^2*q*(q^2 - 1 + pq)/8 if p is even and q is odd.
The first Maple program makes use of the above formulas.
The Hosoya-Wiener polynomial of C(p) X C(q) is 2*h(p)*h(q) + p*h(q) + q*h(p), where h(j) denotes the Hosoya-Wiener polynomial of the cycle C(j).
The command H(p,q) in the 2nd Maple program yields the corresponding Hosoya-Wiener polynomial.
MAPLE
Wi := proc (p, q) if `mod`(p, 2) = 1 and `mod`(q, 2) = 1 then (1/8)*p*q*(p+q)*(p*q-1) elif `mod`(p, 2) = 0 and `mod`(q, 2) = 0 then (1/8)*p^2*q^2*(p+q) elif `mod`(p, 2) = 1 and `mod`(q, 2) = 0 then (1/8)*p*q^2*(p^2+p*q-1) else (1/8)*p^2*q*(q^2+p*q-1) end if end proc: for i to 10 do seq(Wi(i, j), j = 1 .. i) end do; # yields sequence in triangular form
H := proc (p, q) local br, h: br := proc (n) options operator, arrow: sum(t^k, k = 0 .. n-1) end proc: h := proc (m) if `mod`(m, 2) = 0 then m*(br((1/2)*m)-1)+(1/2)*m*t^((1/2)*m) else m*t*br((1/2)*m-1/2) end if end proc: sort(expand(2*h(p)*h(q)+p*h(q)+q*h(p))) end proc: Wi := proc (p, q) options operator, arrow: subs(t = 1, diff(H(p, q), t)) end proc: for i to 10 do seq(Wi(i, j), j = 1 .. i) end do; # yields sequence in triangular form
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Emeric Deutsch, Aug 25 2013
STATUS
approved