OFFSET
0,2
COMMENTS
Sequence extended to a(0) using the formula.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
Eric Weisstein's World of Mathematics, Necklace 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)=n*(1+(-1)^n+12*n^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).
G.f.: 2*x*(3+19*x+28*x^2+19*x^3+3*x^4)/((-1+x)^4*(1+x)^2).
MATHEMATICA
Table[n (1 + (-1)^n + 12 n^2)/2, {n, 0, 20}]
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {6, 50, 162, 388, 750, 1302}, {0, 20}]
CoefficientList[Series[2 x (3 + 19 x + 28 x^2 + 19 x^3 + 3 x^4)/((-1 + x)^4 (1 + x)^2), {x, 0, 20}], x]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Eric W. Weisstein, Feb 15 2026
STATUS
approved
