cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A331250 #16 Aug 28 2023 10:42:27
%S A331250 2,6,10,15,21,28,35,44,52,63,71,84,92,105,118,128,143,159,173,183,200,
%T A331250 214,231,248,264,280,301,316,332,356,370,394,414,428,451,475,494,514,
%U A331250 535,557,580,607,624,645,678,697,718,748,770,794,822,845,873,900,927
%N A331250 a(n) = number of triangles with integer sides i <= j <= k with area <= n.
%H A331250 Chai Wah Wu, <a href="/A331250/b331250.txt">Table of n, a(n) for n = 1..10000</a>
%F A331250 Area A of a triangle with sides a, b, c:
%F A331250 A(a, b, c) = sqrt(s*(s - a)*(s - b)*(s - c)) with s = (a + b + c)/2.
%e A331250 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 A331250 a(1) = 2: 2 triangles (A = 0.43301, 0.96825) with A <= 1,
%e A331250 a(2) = 6: a(1) + 4 triangles (A = 1.4790, 1.7321, 1.9843, 1.9843) with 1 < A <= 2,
%e A331250 a(3) = 10: a(2) + 4 triangles (A = 2.4875, 2.8284, 2.9047, 2.9896) with 2 < A <= 3,
%e A331250 a(4) = 15: a(3) + 5 triangles (A = 3.4911, 3.7997, 3.8730, 3.8971, 3.9922) with 3 < A <= 4,
%e A331250 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 A331250 (Python)
%o A331250 from itertools import count
%o A331250 def A331250(n):
%o A331250     m, c = n**2<<4, 0
%o A331250     for k in count(1):
%o A331250         if (k**2<<2) - 1 > m:
%o A331250             break
%o A331250         for j in range((k>>1)+1,k+1):
%o A331250             for i in range(k-j+1,j+1):
%o A331250                 if ((-i + j + k)*(i - j + k)*(i + j - k)*(i + j + k)) > m:
%o A331250                     break
%o A331250                 c += 1
%o A331250     return c # _Chai Wah Wu_, Aug 25 2023
%Y A331250 Cf. A316853, A317182, A331011, A331251, A331252, A331253.
%K A331250 nonn
%O A331250 1,1
%A A331250 _Hugo Pfoertner_, Jan 20 2020