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.

A385976 Least integer k such that there are exactly n primitive Heron triangles having the same area and perimeter k.

This page as a plain text file.
%I A385976 #46 Aug 28 2025 22:02:14
%S A385976 12,70,98,2002,2842,20026,91698,721786
%N A385976 Least integer k such that there are exactly n primitive Heron triangles having the same area and perimeter k.
%H A385976 BBS Math Blog, <a href="https://bbs.emath.ac.cn/forum.php?mod=viewthread&amp;tid=17031">Primitive Heron triangles with equal perimeter and area</a> (in Chinese).
%e A385976 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.
%e A385976 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.
%e A385976 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.
%t A385976 sol=Association[];
%t A385976 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;
%t A385976 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)];
%t A385976 If[IntegerQ[A],d=ToString@n<>"->"<>ToString@A;t={x,y,z};
%t A385976 If[KeyExistsQ[sol,d]==False,sol[d]={d}];
%t A385976 If[KeyExistsQ[sol,d],AppendTo[sol[d],t]]]]]]];
%t A385976 Do[Print[k,SelectFirst[sol,Length@#==k+1&]],{k,5}]
%o A385976 (Python)
%o A385976 from math import gcd
%o A385976 from collections import Counter
%o A385976 from itertools import count
%o A385976 from sympy.ntheory.primetest import is_square
%o A385976 def A385976(n):
%o A385976     for k in count(6,2):
%o A385976         c = Counter()
%o A385976         for x in range(1,k//3+1):
%o A385976             for y in range(x,k//2+1):
%o A385976                 s, m = k>>1, x+y
%o A385976                 if  (m<<1)>k>=m+y and gcd(x,y,k-m)==1 and is_square(s*(a:=(s-x)*(s-y)*(m-s))):
%o A385976                     c[a]+=1
%o A385976                     if c[a]>n:
%o A385976                         break
%o A385976             else:
%o A385976                 continue
%o A385976             break
%o A385976         else:
%o A385976             if any(c[d]==n for d in c):
%o A385976                 return k # _Chai Wah Wu_, Jul 25 2025
%Y A385976 Cf. A385819.
%K A385976 nonn,hard,more,changed
%O A385976 1,1
%A A385976 _Zhining Yang_, Jul 13 2025
%E A385976 a(7)-a(8) from _Xianwen Wang_, Jul 13 2025
%E A385976 a(3) corrected by _Xianwen Wang_, Aug 19 2025