OFFSET
2,1
COMMENTS
Also the number of chords in the n-triangular grid graph for n >=2.
LINKS
Eric Weisstein's World of Mathematics, Graph Chord.
Eric Weisstein's World of Mathematics, Triangular Grid Graph.
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-1).
G.f.: 3*x^2*(-1 - x + x^2)/(-1 + x)^3.
Sum_{n>=2} 1/a(n) = 2*Pi*tan(sqrt(17)*Pi/2)/(3*sqrt(17)) + 1/2. - Amiram Eldar, Apr 17 2022
MATHEMATICA
Table[3 (n^2 + n - 4)/2, {n, 2, 20}]
LinearRecurrence[{3, -3, 1}, {3, 12, 24}, 20]
CoefficientList[Series[3 (-1 - x + x^2)/(-1 + x)^3, {x, 0, 20}], x]
PROG
(PARI) a(n) = 3*(n^2+n-4)/2 \\ Felix Fröhlich, Jan 03 2018
(PARI) Vec(3*x^2*(x^2-x-1)/(x-1)^3 + O(x^40)) \\ Felix Fröhlich, Jan 03 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Eric W. Weisstein, Jan 03 2018
STATUS
approved