OFFSET
1,2
COMMENTS
A centered hexagonal grid of size n is a grid with A003215(n-1) points forming a hexagonal lattice.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..200
Eric Weisstein's World of Mathematics, Hex Number.
EXAMPLE
For n = 2 the points are on the three diagonals through the center of the hexagon as following:
. . . * * .
* * * . * . . * .
. . * . . *
PROG
(PARI)
c(n, s, fmin, fmax)={sum(k=1+s, n, max(0, fmax(k-s)-max(fmin(k)-1, if(k-2*s>0, fmax(k-2*s)))))}
b(n, u, v)={c(2*n-1, u, i->max(0, i-n)+1+i\u*v, i->min(i, n)+n-1+i\u*v)}
gm(n)={my(v=vector(n)); for(g=2, n, v[g]=binomial(g+1, 3) - sum(k=2, g-1, v[k]*min(k, g-k+1))); v}
a(n)={my(gmv=gm(n-1)); 3*(binomial(2*n-1, 3) + 2*sum(k=0, n-2, binomial(n+k, 3)) + sum(u=1, 2*n-3, sum(v=1, 2*n-2-u, my(m=gmv[gcd(u, v)]); if(m>0, m*b(n, u, v), 0))))} \\ Andrew Howroyd, Sep 18 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Martin Renner, Apr 17 2014
EXTENSIONS
a(7) from Martin Renner, May 31 2014
a(8)-a(22) from Giovanni Resta, May 31 2014
Terms a(23) and beyond from Andrew Howroyd, Sep 18 2017
STATUS
approved