login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = number of triangles with integer sides i <= j <= k with area <= n.
3

%I #16 Aug 28 2023 10:42:27

%S 2,6,10,15,21,28,35,44,52,63,71,84,92,105,118,128,143,159,173,183,200,

%T 214,231,248,264,280,301,316,332,356,370,394,414,428,451,475,494,514,

%U 535,557,580,607,624,645,678,697,718,748,770,794,822,845,873,900,927

%N a(n) = number of triangles with integer sides i <= j <= k with area <= n.

%H Chai Wah Wu, <a href="/A331250/b331250.txt">Table of n, a(n) for n = 1..10000</a>

%F Area A of a triangle with sides a, b, c:

%F A(a, b, c) = sqrt(s*(s - a)*(s - b)*(s - c)) with s = (a + b + c)/2.

%e The sorted list of areas A_k = A(A331251(k), A331252(k), A331253(k)), rounded to 10^-4, starts:: {0.43301, 0.96825, 1.4790, 1.7321, 1.9843, 1.9843, 2.4875, 2.8284, 2.9047, 2.9896, 3.4911, 3.7997, 3.8730, 3.8971, 3.9922, 4.1458, 4.4721, 4.4931, 4.6837, 4.8990, 4.9937, 5.3327, ...}.

%e a(1) = 2: 2 triangles (A = 0.43301, 0.96825) with A <= 1,

%e a(2) = 6: a(1) + 4 triangles (A = 1.4790, 1.7321, 1.9843, 1.9843) with 1 < A <= 2,

%e a(3) = 10: a(2) + 4 triangles (A = 2.4875, 2.8284, 2.9047, 2.9896) with 2 < A <= 3,

%e a(4) = 15: a(3) + 5 triangles (A = 3.4911, 3.7997, 3.8730, 3.8971, 3.9922) with 3 < A <= 4,

%e a(5) = 21: a(4) + 6 triangles (A = 4.1458, 4.4721, 4.4931, 4.6837, 4.8990, 4.9937) with 4 < A <= 5.

%o (Python)

%o from itertools import count

%o def A331250(n):

%o m, c = n**2<<4, 0

%o for k in count(1):

%o if (k**2<<2) - 1 > m:

%o break

%o for j in range((k>>1)+1,k+1):

%o for i in range(k-j+1,j+1):

%o if ((-i + j + k)*(i - j + k)*(i + j - k)*(i + j + k)) > m:

%o break

%o c += 1

%o return c # _Chai Wah Wu_, Aug 25 2023

%Y Cf. A316853, A317182, A331011, A331251, A331252, A331253.

%K nonn

%O 1,1

%A _Hugo Pfoertner_, Jan 20 2020