OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
A. A. Dobrynin, I. Gutman, S. Klavzar, P. Zigert, Wiener Index of Hexagonal Systems, Acta Applicandae Mathematicae 72 (2002), pp. 247-294.
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
a(n) = (1/3)*(16*n^3 + 36*n^2 + 26*n + 3).
G.f.: z*(27+z+5*z^2-z^3)/(1-z)^4.
a(n) = Sum_{k=1,..,2*n+1} k*A143937(n,k).
EXAMPLE
a(1)=27 because in a hexagon we have 6 distances equal to 1, 6 distances equal to 2 and 3 distances equal to 3 (6*1+6*2+3*3=27).
MAPLE
seq((16*n^3+36*n^2+26*n+3)*1/3, n = 1 .. 35)
MATHEMATICA
Table[(1/3)*(16*n^3 + 36*n^2 + 26*n + 3), {n, 1, 50}] (* or *) LinearRecurrence[{4, -6, 4, -1}, {27, 109, 279, 569}, 50] (* G. C. Greubel, Dec 08 2016 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Sep 06 2008
STATUS
approved