OFFSET
1,1
COMMENTS
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(n,1) = 4n; T(n,2) = 6n-4; T(n,2p+1) = 4(n-p); T(n,2p) = 5(n-p)+1.
G.f. = G(q,z) = qz/(4+2q+4qz-q^3*z)/((1-q^2*z)*(1-z)^2).
EXAMPLE
T(2,1)=8 because the chain of 2 squares (<><>) has 8 edges.
Triangle starts:
4, 2;
8, 8, 4, 1;
12, 14, 8, 6, 4, 1;
16, 20, 12, 11, 8, 6, 4, 1;
20, 26, 16, 16, 12, 11, 8, 6, 4, 1;
MAPLE
T:=proc(n, k) if 2*n < k then 0 elif k = 1 then 4*n elif k = 2 then 6*n-4 elif `mod`(k, 2)=1 then 4*n-2*k+2 elif `mod`(k, 2)=0 then 5*n-(5/2)*k+1 else 0 end if end proc: for n to 10 do seq(T(n, k), k=1..2*n) end do; # yields sequence in triangular form
MATHEMATICA
T[n_, k_] := Which[2n < k, 0, k == 1, 4n, k == 2, 6n - 4, OddQ[k], 4n - 2k + 2, EvenQ[k], 5n - (5/2) k + 1, True, 0];
Table[T[n, k], {n, 1, 10}, {k, 1, 2n}] // Flatten (* Jean-François Alcover, Aug 23 2024, after Maple program *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Emeric Deutsch, Sep 06 2008
STATUS
approved