login
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

%I #15 Sep 15 2025 18:09:19

%S 0,-1,0,3,0,15,48,63,128,243,320,495,768,975,1344,1875,2304,2975,3888,

%T 4655,5760,7203,8448,10143,12288,14175,16640,19683,22400,25839,30000,

%U 33759,38400,43923,48960,55055,62208,68783,76608,85683,94080,103935,115248,125775

%N 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.

%C 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.

%C 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.

%H Paolo Xausa, <a href="/A387833/b387833.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Rec#order_11">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1,3,-6,3,-3,6,-3,1,-2,1).

%F a(3m + 0) = 3m^4.

%F a(3m + 1) = 3m^4 + 4m^3 - 2m^2 - 4m - 1.

%F a(3m + 2) = 3m^4 + 8m^3 + 4m^2.

%e 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.

%e 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.

%e 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.

%t A387833[n_] := 3*#^4 + Switch[Mod[n, 3], 0, 0, 1, 4*#^3 - 2*#^2 - 4*# - 1, _, 8*#^3 + 4*#^2] & [Quotient[n, 3]];

%t Array[A387833, 50, 0] (* or *)

%t 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 *)

%Y Cf. A002620 (rectangle), A005044 (number of nondegenerate triangles).

%K sign,easy

%O 0,4

%A _Curtis Bechtel_, Sep 09 2025