OFFSET
0,4
COMMENTS
This includes degenerate triangles with an edge of length 0, for which the area is 0. If they are excluded, then a(n) = -1 for n = 0, 2, and 4.
There is a unique triangle of maximum area (modulo isometries) for all n except n = 1, which has no valid triangles, and n = 4, which has no triangles of positive area and two distinct degenerate triangles of area 0 with side lengths (0, 2, 2) and (1, 1, 2). For all other n, the unique maximum area triangle has side lengths (m, m, m) when n = 3m, (m, m, m + 1) when n = 3m + 1, and (m, m + 1, m + 1) when n = 3m + 2.
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (2,-1,3,-6,3,-3,6,-3,1,-2,1).
FORMULA
a(3m + 0) = 3m^4.
a(3m + 1) = 3m^4 + 4m^3 - 2m^2 - 4m - 1.
a(3m + 2) = 3m^4 + 8m^3 + 4m^2.
EXAMPLE
For n = 3, there is a unique triangle (modulo isometries) with integer side lengths and perimeter n. It is an equilateral triangle with sides of length 1, and it has area sqrt(3) / 4. Therefore, a(3) = 3.
For n = 7, there are two such triangles, given by side lengths (1, 3, 3) and (2, 2, 3). The first has area sqrt(35) / 4 and the second sqrt(63) / 4. Therefore, a(7) = 63.
For n = 11, there are four such triangles, given by side lengths (1, 5, 5), (2, 4, 5), (3, 3, 5), and (3, 4, 4). The corresponding areas are sqrt(99) / 4, sqrt(231) / 4, sqrt(275) / 4, and sqrt(495) / 4. Therefore, a(11) = 495.
MATHEMATICA
A387833[n_] := 3*#^4 + Switch[Mod[n, 3], 0, 0, 1, 4*#^3 - 2*#^2 - 4*# - 1, _, 8*#^3 + 4*#^2] & [Quotient[n, 3]];
Array[A387833, 50, 0] (* or *)
LinearRecurrence[{2, -1, 3, -6, 3, -3, 6, -3, 1, -2, 1}, {0, -1, 0, 3, 0, 15, 48, 63, 128, 243, 320}, 50] (* Paolo Xausa, Sep 15 2025 *)
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Curtis Bechtel, Sep 09 2025
STATUS
approved
