OFFSET
1,1
LINKS
BBS Math Blog, Primitive Heron triangles with equal perimeter and area (in Chinese).
EXAMPLE
a(3) = 98 because there exists 3 primitive Heron triangles: {{29, 29, 40}, {25, 34, 39}, {24, 37, 37}} with same area 420 and same perimeter 98.
a(6) = 20026 because there exists 6 primitive Heron triangles: {{2108,8493,9425}, {2173,8398,9455}, {2261,8277,9488},{2418,8075,9533},{4123,6205,9698},{4588,5729,9709}} with same area 8410920 and same perimeter 20026.
a(8) = 721786 because there exists 8 primitive Heron triangles: {{188105,189428,344253}, {179133,198458,344195},{124338,256523,340925}, {116093,266029,339664}, {91448,299013,331325}, {88253,304980,328553}, {85981,310493,325312}, {85618,311627,324541}} with same area 13338605280 and same perimeter 721786.
MATHEMATICA
sol=Association[];
For[n=6, n<=3000, n+=2, For[z=Ceiling[n/3], z<Floor[n/2], z++, For[x=1, x<Floor[n/3], x++, y=n-x-z;
If[x+y>z>=y>=x&&GCD[x, y, z]==1, p=(x+y+z)/2; A=Sqrt[p (p-x) (p-y) (p-z)];
If[IntegerQ[A], d=ToString@n<>"->"<>ToString@A; t={x, y, z};
If[KeyExistsQ[sol, d]==False, sol[d]={d}];
If[KeyExistsQ[sol, d], AppendTo[sol[d], t]]]]]]];
Do[Print[k, SelectFirst[sol, Length@#==k+1&]], {k, 5}]
PROG
(Python)
from math import gcd
from collections import Counter
from itertools import count
from sympy.ntheory.primetest import is_square
def A385976(n):
for k in count(6, 2):
c = Counter()
for x in range(1, k//3+1):
for y in range(x, k//2+1):
s, m = k>>1, x+y
if (m<<1)>k>=m+y and gcd(x, y, k-m)==1 and is_square(s*(a:=(s-x)*(s-y)*(m-s))):
c[a]+=1
if c[a]>n:
break
else:
continue
break
else:
if any(c[d]==n for d in c):
return k # Chai Wah Wu, Jul 25 2025
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Zhining Yang, Jul 13 2025
EXTENSIONS
a(7)-a(8) from Xianwen Wang, Jul 13 2025
a(3) corrected by Xianwen Wang, Aug 19 2025
STATUS
approved
