OFFSET
0,4
COMMENTS
Wiener index of cycle of length n.
a(n+1) is the sum of labeled number of boxes arranged as pyramid with base n. The sum of boxes is A002620(n+1). See the illustration in links. - Kival Ngaokrajang, Jul 02 2013
LINKS
T. D. Noe, Table of n, a(n) for n = 0..1000
M. Janjic and B. Petkovic, A Counting Function, arXiv 1301.4550 [math.CO], 2013.
Kival Ngaokrajang, Illustration for n = 1..10.
Eric Weisstein's World of Mathematics, Wiener Index.
H. J. Wiener, Structural Determination of Paraffin Boiling Points, J. Amer. Chem. Soc. 69 (1947), 17-20.
J. Zerovnik, Szeged index of symmetric graphs, J. Chem. Inf. Comput. Sci., 39 (1999), 77-80.
Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
FORMULA
a(n) = (n^2-1)*n/8 if n is odd, otherwise n^3/8.
From Paul Barry, May 13 2005: (Start)
G.f.: x^2*(1+x+x^2)/((1-x)^2*(1-x^2)^2).
a(n) = 2*a(n-1) +a(n-2) -4*a(n-3) +a(n-4) +2*a(n-5) -a(n-6).
a(n) = (2*n^3 +12*n^2 +23*n +14)/16 +(n+2)*(-1)^n/16.
a(n) = Sum_{k=0..floor((n+2)/2)} ((n+2)/(n+2-k))(-1)^k*C(n+2-k, k)* C(n-2*k+2, 2)*C(n-2*k, floor((n-2*k)/2)). [Typo corrected by R. J. Mathar, Aug 18 2008] (End)
a(n) = (2*n^2 - 1 + (-1)^n) * n / 16. - Michael Somos, Sep 06 2008
Euler transform of length 3 sequence [3, 2, -1]. - Michael Somos, Sep 06 2008
a(-n) = -a(n). - Michael Somos, Sep 06 2008
a(n) = (-n + Sum_{k=1..n} A007310(k)^2)/24. - Jesko Matthes, Feb 19 2021
Sum_{n>=2} 1/a(n) = 6 - 8*log(2) + zeta(3). - Amiram Eldar, Apr 16 2022
a(n) = Sum_{k=1..n} A062717(k)/4. - Sela Fried, Jun 27 2022
EXAMPLE
G.f.: x^2 + 3*x^3 + 8*x^4 + 15*x^5 + 27*x^6 + 42*x^7 + 64*x^8 + 90*x^9 + ...
MAPLE
MATHEMATICA
Table[Floor[n^2/4] n/2, {n, 0, 50}] (* Harvey P. Dale, Jun 10 2011 *)
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {0, 0, 1, 3, 8, 15}, 50] (* Harvey P. Dale, Jun 10 2011 *)
PROG
(PARI) {a(n) = (n^2 \ 4) * n / 2} /* Michael Somos, Sep 06 2008 */
(PARI) {a(n) = if( n<0, -a(-n), polcoeff( x^2 * (1 + x + x^2) / ((1 - x)^2 * (1 - x^2)^2) + x * O(x^n), n))} /* Michael Somos, Sep 06 2008 */
(Magma) [Floor(n^2/4)*(n/2): n in [0..50]]; // G. C. Greubel, Feb 23 2018
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
Definition reworded by Michael Somos, Sep 06 2008
STATUS
approved