%I #31 Feb 17 2024 04:04:57
%S 0,21,171,666,1830,4095,8001,14196,23436,36585,54615,78606,109746,
%T 149331,198765,259560,333336,421821,526851,650370,794430,961191,
%U 1152921,1371996,1620900,1902225,2218671,2573046,2968266,3407355,3893445,4429776,5019696,5666661
%N Number of ways to choose two points on a centered hexagonal grid of size n.
%C A centered hexagonal grid of size n is a grid with A003215(n-1) points forming a hexagonal lattice.
%C a(n) is also the number of segments on a centered hexagonal grid of size n.
%H Vincenzo Librandi, <a href="/A241219/b241219.txt">Table of n, a(n) for n = 1..1000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HexNumber.html">Hex Number</a>.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (5,-10,10,-5,1).
%F a(n) = binomial(A003215(n-1), 2).
%F = binomial(3*n^2-3*n+1, 2).
%F = 3/2*n*(n-1)*(3*n^2-3*n+1).
%F = 9/2*n^4-9*n^3+6*n^2-3/2*n.
%F G.f.: -3*x^2*(7*x^2+22*x+7) / (x-1)^5. - _Colin Barker_, Apr 18 2014
%F Sum_{n>=2} 1/a(n) = 8/3 - 2*Pi*tanh(Pi/(2*sqrt(3)))/sqrt(3). - _Amiram Eldar_, Feb 17 2024
%p seq(binomial(3*n^2-3*n+1, 2),n=1..34); # _Martin Renner_, Apr 27 2014
%p op(PolynomialTools[CoefficientList](convert(series(-3*x^2*(7*x^2+22*x+7)/(x-1)^5, x=0, 35), polynom), x)[2..35]); # _Martin Renner_, Apr 27 2014
%t CoefficientList[Series[-3 x^2 (7 x^2 + 22 x + 7)/(x - 1)^5, {x, 0, 50}], x] (* _Vincenzo Librandi_, Apr 19 2014 *)
%o (PARI) concat(0, Vec(-3*x^2*(7*x^2+22*x+7) / (x-1)^5 + O(x^100))) \\ _Colin Barker_, Apr 18 2014
%o (Magma) [Binomial(3*n^2-3*n+1, 2): n in [1..35]]; // _Vincenzo Librandi_, Apr 19 2014
%Y Cf. A003215, A083374.
%K nonn,easy
%O 1,2
%A _Martin Renner_, Apr 17 2014
%E Typo in Mathematica program fixed by _Martin Renner_, Apr 27 2014