This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A047786 #27 Jul 15 2023 06:25:14 %S A047786 0,6,87,417,1278,3060,6261,11487,19452,30978,46995,68541,96762,132912, %T A047786 178353,234555,303096,385662,484047,600153,735990,893676,1075437, %U A047786 1283607,1520628,1789050,2091531,2430837,2809842,3231528,3698985,4215411,4784112,5408502 %N A047786 a(n) = (9*n^4 + 4*n^3 - n)/2. %C A047786 In a triangular lattice, draw a regular hexagon of side length n (that is, n+1 points on a side). Then a(n) is the number of ways to choose two lattice points that do not lie on a line parallel to any side of the hexagon. (See the Bennett and Potts paper.) - _Mikhail Lavrov_, Jun 12 2023 %H A047786 Vincenzo Librandi, <a href="/A047786/b047786.txt">Table of n, a(n) for n = 0..1000</a> %H A047786 B. T. Bennett and R. B. Potts, <a href="https://doi.org/10.1017/S144678870000505X">Arrays and brooks</a>, J. Austral. Math. Soc., 7 (1967), 23-31 (see p. 30). %H A047786 B. T. Bennett and R. B. Potts, <a href="/A002047/a002047_1.pdf">Arrays and brooks</a>, J. Austral. Math. Soc., 7 (1967), 23-31. [Annotated scanned copy] %H A047786 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (5, -10, 10, -5, 1). %F A047786 O.g.f.: 3*x*(2 + 19*x + 14*x^2 + x^3)/(1-x)^5. - _R. J. Mathar_, Feb 26 2008 %F A047786 E.g.f.: x*(12 + 75*x + 58*x^2 + 9*x^3)*exp(x)/2. - _Robert Israel_, May 29 2016 %e A047786 From _Mikhail Lavrov_, Jun 12 2023: (Start) %e A047786 For n=1 the a(1)=6 ways to choose two points are illustrated below: %e A047786 . %e A047786 . X o o X o o o o X o o X %e A047786 . o o X o o o o o X X o o o o o X o o %e A047786 . o o o X X o o X X o o o %e A047786 . %e A047786 (End) %t A047786 Table[(9n^4+4n^3-n)/2,{n,0,30}] (* or *) LinearRecurrence[{5,-10,10,-5,1},{0,6,87,417,1278},30] (* _Harvey P. Dale_, May 26 2016 *) %o A047786 (Magma) [(9*n^4+4*n^3-n)/2: n in [0..40]]; // _Vincenzo Librandi_, May 29 2016 %o A047786 (PARI) {a(n) = n*(9*n^3 +4*n^2 -1)/2}; \\ _G. C. Greubel_, May 17 2019 %o A047786 (Sage) [n*(9*n^3 +4*n^2 -1)/2 for n in (0..30)] # _G. C. Greubel_, May 17 2019 %o A047786 (GAP) List([0..30], n-> n*(9*n^3 +4*n^2 -1)/2) # _G. C. Greubel_, May 17 2019 %Y A047786 The number of points in the hexagon is A003215. The number of ways to choose 2n+1 points, no two of which are on a line, is A002047. %K A047786 nonn,easy %O A047786 0,2 %A A047786 _N. J. A. Sloane_