OFFSET
1,1
COMMENTS
Gives the row lengths of the irregular array A290451.
LINKS
James Grime and Brady Haran, Superhero Triangles, Numberphile video (2020).
EXAMPLE
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.
MATHEMATICA
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 *)
PROG
(Python)
from math import sqrt
def A332689(n):
L = []; k = 4*n*n
for x in range(1, int(2*sqrt(3)*n) + 1):
for y in range(max(int(k/x) + 1, x), int((k + 2*n*sqrt(k + x*x))/x) + 1):
if k*(x+y)%(x*y-k) == 0:
s = x + y + k*(x+y)//(x*y-k)
if s not in L: L.append(s)
return len(L) # Ya-Ping Lu, Dec 28 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeppe Stig Nielsen, Feb 19 2020
EXTENSIONS
a(8)-a(54) from Giovanni Resta, Mar 04 2020
STATUS
approved