login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A340130
Number of convex polygons on the lines of a triangular grid with edge length n.
1
1, 11, 50, 157, 398, 876, 1742, 3208, 5561, 9179, 14548, 22281, 33138, 48048, 68132, 94728, 129417, 174051, 230782, 302093, 390830, 500236, 633986, 796224, 991601, 1225315, 1503152, 1831529, 2217538, 2668992, 3194472, 3803376, 4505969, 5313435, 6237930, 7292637
OFFSET
1,2
COMMENTS
"On the grid lines" means that each corner is a grid point and neighbored corners are located on a common grid line. For n=1, the only polygon is a triangle: a(1)=1. For n=2, there are (additionally) 4 triangles, 3 parallelograms and 3 trapezes: a(2)=11, see examples. For n=3, there are (additionally) 8 triangles, 12 parallelograms, 15 trapezes, 3 pentagons and 1 hexagon:
a(3)=11+39=50. Other sorts of polygons do not occur for n>3. The derivation of the algorithm, used in the maxima code, and of the formula, see link "Convex polygons on a triangular grid". In the appendix, you find all a(3)-a(2)=39 polygons and a second algorithm for safety.
FORMULA
a(n) = (n*(n + 2)*(2*n^4 + 32*n^3 + 201*n^2 + 138*n - 48) - h)/960 with h = 0 for even n and h = 15 for odd n.
From Stefano Spezia, Dec 29 2020: (Start)
G.f.: x*(1 + 5*x - 2*x^2 - 3*x^3 + 2*x^4)/((1 - x)^7*(1 + x)).
a(n) = 6*a(n-1) - 14*a(n-2) + 14*a(n-3) - 14*a(n-5) + 14*a(n-6) - 6*a(n-7) + a(n-8) for n > 8. (End)
EXAMPLE
a(2)=11 polygons (first polygon: a(1)=1)
-
o o o o
o o o o o o o o
. . . . o . o o . . o o
-
o . . .
o o o . o o o o
o o o o o . . o . o o .
-
. . .
o o . o o o
o o o . o o . o o
PROG
(Maxima)
block(nmax: 36, a: [], su:0,
/*returns the first nmax terms*/
for n from 1 thru nmax do
(for di from 1 thru n do
for k from 0 thru n-di do
for dk from 1 thru n-k do
(if dk<=di then
(ad: (dk+1) * (1+min(dk, n-di-k)),
if dk=di then ad: ad-1)
else
ad: (di+1) * (1+min(di, n-dk-k)),
su: su + ad),
a: append(a, [su])),
return(a));
CROSSREFS
Sequence in context: A185019 A212560 A341735 * A211920 A167423 A026618
KEYWORD
nonn,easy
AUTHOR
Gerhard Kirchner, Dec 29 2020
STATUS
approved