cp's OEIS Frontend

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.

A047786 a(n) = (9*n^4 + 4*n^3 - n)/2.

Original entry on oeis.org

0, 6, 87, 417, 1278, 3060, 6261, 11487, 19452, 30978, 46995, 68541, 96762, 132912, 178353, 234555, 303096, 385662, 484047, 600153, 735990, 893676, 1075437, 1283607, 1520628, 1789050, 2091531, 2430837, 2809842, 3231528, 3698985, 4215411, 4784112, 5408502
Offset: 0

Views

Author

Keywords

Comments

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

Examples

			From _Mikhail Lavrov_, Jun 12 2023: (Start)
For n=1 the a(1)=6 ways to choose two points are illustrated below:
.
.    X o     o X     o o     o o     X o     o X
.   o o X   o o o   o o X   X o o   o o o   X o o
.    o o     o X     X o     o X     X o     o o
.
(End)
		

Crossrefs

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.

Programs

  • GAP
    List([0..30], n-> n*(9*n^3 +4*n^2 -1)/2) # G. C. Greubel, May 17 2019
  • Magma
    [(9*n^4+4*n^3-n)/2: n in [0..40]]; // Vincenzo Librandi, May 29 2016
    
  • Mathematica
    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 *)
  • PARI
    {a(n) = n*(9*n^3 +4*n^2 -1)/2}; \\ G. C. Greubel, May 17 2019
    
  • Sage
    [n*(9*n^3 +4*n^2 -1)/2 for n in (0..30)] # G. C. Greubel, May 17 2019
    

Formula

O.g.f.: 3*x*(2 + 19*x + 14*x^2 + x^3)/(1-x)^5. - R. J. Mathar, Feb 26 2008
E.g.f.: x*(12 + 75*x + 58*x^2 + 9*x^3)*exp(x)/2. - Robert Israel, May 29 2016