Jim Ferry also asks what the answer to the analogous question for larger polygons might be. Any takers?
Ignacio Larrosa Cañestro's explanation:
Let be a, c', b, a', c and b' the sides of the equiangular hexagon in cyclic order. Let H(n) the number of them with perimeter n and integer length sides. Each pair of opposite sides, (a, a'), (b, b') and (c, c') must be parallels. Then we have a + a' + b + b' + c + c' = n c' + b = c + b' a' + c = a + c' b' + a = b + a' ===> a' - a = b' - b = c' - c = k a' = a + k, b' = b + k, c' = c + k a, b, c >= 1 I will take k >= 0 to avoid duplicities and without lost of generallity. Also, by the same reason, a >= b >= c. Then (a' + b' + c') + (a + b + c) = n (a' + b' + c') - (a + b + c) = 3k ===> a' + b' + c' = (n + 3k)/2 a + b + c = (n - 3k)/2 As a, b, c >=1, must be 0 <= k <= (n - 6)/3. Also k must be of the same parity of n. Then if P3(m) is the number of partitions of m in three positive (> 0) integers, we have that its generating function is x^3/((1-x)(1-x^2)(1-x^3)) = Sum(P3(m)*x^m, m, 0, inf) H(n) = Sum(P3((n - 3k)/2)), k, n Mod 2, floor((n-6)/3), 2) For n = 100 H(100) = Sum(P3((100 - 3k)/2)), k, 0, 31, 2) = Sum(P3(50 - 3k'), k', 0, 15) = Sum(P3(k"), k", 5, 50, 3) = P3(5) + P3(8) + ... + P3(47) + P3(50) = = 2 + 5 + 10 + 16 + 24 + 33 + 44 + 56 + 70 + 85 + 102 + 120 + 140 + 161 + 184 + 208 = 1260
A closed form for P3(m) is:
m2/12 | for m = 0 mod 6 | |
(m2 - 1)/12 | for m = 1 or 5 mod 6 | |
(m2 - 4)/12 | for m = 2 or 4 mod 6 | |
(m2 + 3)/12 | for m = 3 mod 6 |
Using the argument above along with the closed form for P3(m) one can derive the following.
Al Zimmerman's formulas:
n modulo 12 Number of hexagons --------------------------------------------- 0 (n^3 + 9n^2 + 36n - 0) / 864 1 (n^3 - 39n + 38) / 864 2 (n^3 + 9n^2 - 12n - 20) / 864 3 (n^3 + 9n - 54) / 864 4 (n^3 + 9n^2 - 12n - 160) / 864 5 (n^3 - 39n + 70) / 864 6 (n^3 + 9n^2 + 36n + 108) / 864 7 (n^3 - 39n - 70) / 864 8 (n^3 + 9n^2 - 12n - 128) / 864 9 (n^3 + 9n + 54) / 864 10 (n^3 + 9n^2 - 12n - 52) / 864 11 (n^3 - 39n - 38) / 864
The (ordinary) generating function (courtesy of Jim Ferry):
x^6/((1-x^2)(1-x^3)(1-x^4)(1-x^6))