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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

12, 70, 98, 2002, 2842, 20026, 91698, 721786
Offset: 1

Views

Author

Zhining Yang, Jul 13 2025

Keywords

Examples

			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.
		

Crossrefs

Cf. A385819.

Programs

  • Mathematica
    sol=Association[];
    For[n=6,n<=3000,n+=2,For[z=Ceiling[n/3],zz>=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}]
  • 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

Extensions

a(7)-a(8) from Xianwen Wang, Jul 13 2025
a(3) corrected by Xianwen Wang, Aug 19 2025
Showing 1-1 of 1 results.