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.
%I A332689 #27 Dec 29 2023 08:06:21 %S A332689 5,17,41,41,47,127,77,81,171,132,99,283,94,205,349,158,115,457,122, %T A332689 296,530,267,134,546,219,260,428,471,130,953,144,264,613,332,557,1031, %U A332689 139,346,614,600,162,1381,169,562,1132,348,186,1000,363,593,688,571,164,1123 %N A332689 Number of distinct areas of integer-sided triangles whose area equals n times their perimeter. %C A332689 Gives the row lengths of the irregular array A290451. %H A332689 James Grime and Brady Haran, <a href="https://www.youtube.com/watch?v=UIjeCKPHbso">Superhero Triangles</a>, Numberphile video (2020). %e A332689 For n = 2, there are 18 different (noncongruent) Heronian triangles whose area equals twice their perimeter, so A007237(2) = 18. However, two of those 18 triangles share the area 168. So there are only 17 distinct areas. Therefore, a(2) = 17. %t A332689 a[k_] := Block[{v={},r,s,t}, Do[ If[r <= s && 4 k^2 < r s <= 12 k^2 && IntegerQ[t = 4 k^2 (r + s)/(r s - 4 k^2)] && t >= s, AppendTo[v, r + s + t]], {r, Floor[2 Sqrt[3] k]}, {s, Floor[4 k^2/r], Ceiling[12 k^2/r]}]; Length@ Union@ v]; Array[a, 20] (* _Giovanni Resta_, Mar 04 2020 *) %o A332689 (Python) %o A332689 from math import sqrt %o A332689 def A332689(n): %o A332689 L = []; k = 4*n*n %o A332689 for x in range(1, int(2*sqrt(3)*n) + 1): %o A332689 for y in range(max(int(k/x) + 1, x), int((k + 2*n*sqrt(k + x*x))/x) + 1): %o A332689 if k*(x+y)%(x*y-k) == 0: %o A332689 s = x + y + k*(x+y)//(x*y-k) %o A332689 if s not in L: L.append(s) %o A332689 return len(L) # _Ya-Ping Lu_, Dec 28 2023 %Y A332689 Cf. A007237, A290451. %K A332689 nonn %O A332689 1,1 %A A332689 _Jeppe Stig Nielsen_, Feb 19 2020 %E A332689 a(8)-a(54) from _Giovanni Resta_, Mar 04 2020