OFFSET
1,2
COMMENTS
The n-pan graph is obtained by joining with an edge a node in the cycle graph C_n to the singleton graph P_1. The Wiener index of a connected graph is the sum of distances between all unordered pairs of vertices in the graph.
The n-pan graph is a special case of the tadpole graph.
Extended to a(1)-a(2) using the formula/recurrence.
LINKS
Eric Weisstein's World of Mathematics, Pan Graph
Eric Weisstein's World of Mathematics, Tadpole Graph
Eric Weisstein's World of Mathematics, Wiener Index
Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
FORMULA
a(n) = A180860(n,1) for n>2.
a(n) = (1/8)*n*(n^2 + 2*n + 8) if n is even; a(n) = (1/8)*(n^3 + 2*n^2 + 7*n - 2) if n is odd.
From R. J. Mathar, Sep 29 2010: (Start)
a(n) = +2*a(n-1) +a(n-2) -4*a(n-3) +a(n-4) +2*a(n-5) -a(n-6).
G.f.: x*(1 + 2*x - x^2 + x^4)/((1 - x)^4*(1 + x)^2). (End)
a(n) = (-2 + 15*n + 4*n^2 + 2*n^3 + (-1)^n*(2 + n))/16. - Eric W. Weisstein, Sep 08 2017
EXAMPLE
a(3)=8 because the graph consists of a triangle ABCA and an edge AD; the distances are d(A,B)=d(B,C)=d(C,A)=d(A,D)=1 and d(DB)=d(DC)=2.
MAPLE
a := proc (n) if `mod`(n, 2) = 0 then (1/8)*n*(n^2+2*n+8) else (1/8)*n^3+(1/4)*n^2+(7/8)*n-1/4 end if end proc: seq(a(n), n = 1 .. 50);
MATHEMATICA
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {1, 4, 8, 16, 26, 42}, 50] (* Harvey P. Dale, Jun 04 2015 *)
Table[(-2 + 15 n + 4 n^2 + 2 n^3 + (-1)^n (2 + n))/16, {n, 20}] (* Eric W. Weisstein, Sep 08 2017 *)
CoefficientList[Series[(1 + 2 x - x^2 + x^4)/((1 - x)^4 (1 + x)^2), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 08 2017 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Sep 27 2010
EXTENSIONS
a(1)-a(2) and new offset from Eric W. Weisstein, Sep 08 2017
STATUS
approved