login
A387833
sqrt(a(n)) / 4 is the maximum area of any triangle with integer side lengths whose perimeter is n, or a(n) = -1 if there is no such triangle.
1
0, -1, 0, 3, 0, 15, 48, 63, 128, 243, 320, 495, 768, 975, 1344, 1875, 2304, 2975, 3888, 4655, 5760, 7203, 8448, 10143, 12288, 14175, 16640, 19683, 22400, 25839, 30000, 33759, 38400, 43923, 48960, 55055, 62208, 68783, 76608, 85683, 94080, 103935, 115248, 125775
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.
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
Cf. A002620 (rectangle), A005044 (number of nondegenerate triangles).
Sequence in context: A086479 A091000 A361804 * A389409 A375591 A351155
KEYWORD
sign,easy
AUTHOR
Curtis Bechtel, Sep 09 2025
STATUS
approved