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-5 of 5 results.

A331676 Ceiling of circumradius of triangle with consecutive prime sides.

Original entry on oeis.org

5, 8, 7, 9, 10, 12, 15, 17, 20, 22, 24, 26, 28, 32, 34, 37, 39, 41, 44, 46, 49, 53, 56, 58, 60, 62, 64, 68, 72, 77, 79, 82, 85, 89, 91, 94, 97, 101, 103, 107, 109, 112, 114, 117, 123, 128, 131, 133, 135, 138, 141, 145, 149, 152, 155, 158, 160, 162, 166, 171, 176, 180
Offset: 2

Views

Author

Frank M Jackson, Jan 24 2020

Keywords

Comments

The sequence starts at offset 2 because using the first three primes yields a triangle with sides (2,3,5) that is degenerate with infinite circumradius.
Also the first two triangles in this sequence with sides (3,5,7) and (5,7,11) are obtuse and do not have their circumcentres within the bounds of the triangle. Thereafter, the triangles are acute and their circumcentres lie within the bounds of the triangle.

Examples

			a(2)=5 because a triangle with sides 3,5,7 has area = (1/4)*sqrt((3+5+7)(3+5-7)(3-5+7)(-3+5+7)) = 6.495... and circumradius = 3*5*7/(4A) = 4.041...
		

Crossrefs

Programs

  • Mathematica
    lst = {}; Do[{a, b, c}={Prime[n], Prime[n+1], Prime[n+2]}; s=(a+b+c)/2; A=Sqrt[s(s-a)(s-b)(s-c)]; R=a*b*c/(4 A); AppendTo[lst, Ceiling@R], {n, 2, 200}]; lst
    ccr[{a_,b_,c_}]:=Module[{s=(a+b+c)/2,A},A=Sqrt[s(s-a)(s-b)(s-c)];Ceiling[(a*b*c)/(4A)]]; ccr/@Partition[Prime[Range[2,70]],3,1] (* Harvey P. Dale, Aug 02 2025 *)

Formula

Circumradius R of a triangle with sides a, b, c is given by R = a*b*c/(4A) where the area A is given by Heron's formula A = sqrt(s(s-a)(s-b)(s-c)) and where s = (a+b+c)/2.

A338267 a(n) is the nearest integer to the area of a triangle with sides prime(n), prime(n+1), prime(n+2).

Original entry on oeis.org

0, 6, 13, 38, 71, 108, 159, 218, 317, 436, 550, 697, 817, 961, 1185, 1425, 1667, 1884, 2134, 2377, 2635, 3009, 3438, 3931, 4351, 4645, 4888, 5200, 5778, 6548, 7485, 7955, 8653, 9238, 10033, 10642, 11389, 12151, 12928, 13653, 14570, 15324, 16233, 16683, 17676, 19153, 20963, 22174, 22832, 23620
Offset: 1

Views

Author

Robert Israel, Oct 19 2020

Keywords

Comments

It appears that the area is rational only for n=1.

Examples

			a(3)=13 because the third, fourth and fifth primes are 5,7,11, the area of a triangle with sides 5, 7, 11 is 3*sqrt(299)/4, and the nearest integer to that is 13.
		

Crossrefs

Programs

  • Maple
    atr:= proc(p,q,r) local s; s:= (p+q+r)/2; sqrt(s*(s-p)*(s-q)*(s-r)) end proc:
    P:= [seq(ithprime(i),i=1..102)]:
    seq(round(atr(P[i],P[i+1],P[i+2])),i=1..100);
  • Mathematica
    aTr[{a_,b_,c_}]:=Module[{s=(a+b+c)/2},Round[Sqrt[s(s-a)(s-b)(s-c)]]]; aTr/@Partition[Prime[ Range[ 60]],3,1] (* Harvey P. Dale, Dec 14 2023 *)
  • Python
    from sympy import prime, integer_nthroot
    def A338267(n):
        p, q, r = prime(n)**2, prime(n+1)**2, prime(n+2)**2
        return (integer_nthroot(4*p*q-(p+q-r)**2,2)[0]+2)//4 # Chai Wah Wu, Oct 19 2020

Formula

a(n) = round(sqrt(s*(s-prime(n))*(s-prime(n+1))*(s-prime(n+2)))) where s = (prime(n)+prime(n+1)+prime(n+2))/2.
a(n) = round(sqrt((3/16)*A330096(n))). - Hugo Pfoertner, Oct 19 2020

A338262 Primes p such that the area of the triangle with sides p and the next two primes achieves a record for closeness to a prime.

Original entry on oeis.org

2, 3, 5, 239, 2521, 12239, 121421, 869657, 23638231, 30656909, 47964149, 48203291, 57273361, 552014783, 754751369, 941234383
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Oct 19 2020

Keywords

Examples

			a(3)=5 is in the sequence because 5 is a prime, the triangle with sides 5, 7, 11 has area 3*sqrt(299)/4 whose distance to the nearest prime, 13, is approximately 0.0313, and this is less than any distance previously achieved.
		

Crossrefs

Programs

  • Maple
    atr:= proc(p,q,r) local s; s:= (p+q+r)/2; sqrt(s*(s-p)*(s-q)*(s-r)) end proc:
    R:= 2,3: p:= 3: q:= 5: r:= 7: count:= 2: dmin:= 7 - atr(3,5,7):
    while count < 8 do
    p:= q: q:= r: r:= nextprime(r);
    a:= atr(p,q,r);
    m:= round(a);
    if not isprime(m) then next fi;
    d:= abs(a-m);
    if is(d < dmin) then
      count:= count+1;
      dmin:= d;
      R:= R, p;
    fi
    od:
    R;
  • PARI
    lista(nn) = {my(m=p=3, q=5, s, t); print1(2); forprime(r=7, nn, s=sqrt((p-s=(p+q+r)/2)*(q-s)*(s-r)*s); if(m>t=min(s-precprime(s), nextprime(s)-s), print1(", ", p); m=t); p=q; q=r); } \\ Jinyuan Wang, Oct 24 2020

Extensions

a(10)-a(16) from Jinyuan Wang, Oct 24 2020

A338269 Odd primes p such that the area of the triangle with sides p and the next two primes achieves a record for closeness to an integer.

Original entry on oeis.org

3, 5, 103, 149, 337, 491, 1559, 1753, 5009, 12239, 44381, 219097, 2789881, 3137357, 4012297, 4171337, 4217693, 5910397, 6837499, 23800489, 53253617, 994831501, 2894057281, 3415613611, 39349394531
Offset: 1

Views

Author

Robert Israel, Oct 19 2020

Keywords

Examples

			a(3)=103 is in the sequence because 103 is a prime, the triangle with sides 103 and the next two primes 107 and 109 has area sqrt(382278435)/4 whose distance to the nearest integer, 4888, is approximately 0.0145, and this is less than any distance previously achieved.
		

Crossrefs

Programs

  • Maple
    atr:= proc(p,q,r) local s; s:= (p+q+r)/2; sqrt(s*(s-p)*(s-q)*(s-r)) end proc:
    p:= 2: q:= 3: r:= 5: count:= 0: R:= NULL: dmin:= infinity:
    while count < 10 do
      p:= q; q:= r; r:= nextprime(r);
      a:= atr(p,q,r);
      d:= abs(a - round(a));
      if is(d < dmin) then
        count:= count+1;
        dmin:= d;
        R:= R, p;
      fi;
    od:
    R;
  • PARI
    lista(nn) = {my(m=p=3, q=5, s, t); forprime(r=7, nn, s=sqrt((p-s=(p+q+r)/2)*(q-s)*(s-r)*s); if(m>t=min(s-floor(s), ceil(s)-s), print1(p, ", "); m=t); p=q; q=r); } \\ Jinyuan Wang, Oct 24 2020

Extensions

a(13)-a(25) from Jinyuan Wang, Oct 24 2020

A330496 Squared area of quadrilateral with sides prime(n), prime(n+1), prime(n+2), prime(n+3) of odd primes configured as a cyclic quadrilateral. Sequence index starts at n=2 to omit the even prime.

Original entry on oeis.org

960, 5005, 17017, 46189, 96577, 212625, 394240, 765049, 1361920, 2027025, 3065857, 4385745, 6314112, 8973909, 12780049, 17116960, 21191625, 27428544, 33980800, 42600829, 56581525, 72382464, 89835424, 107972737, 121330189, 135745657, 167244385, 204917929
Offset: 2

Views

Author

Frank M Jackson, Dec 16 2019

Keywords

Comments

If a, b, c, d are consecutive odd primes configured as a cyclic quadrilateral, then Brahmagupta's formula K = sqrt((a+b+c-d)(a+b-c+d)(a-b+c+d)(-a+b+c+d))/16 means that K^2 will always be an integer. The only cyclic quadrilateral with consecutive prime sides starting with side 2 has a rational squared area of 3003/16.

Examples

			a(2)=960 because cyclic quadrilateral with sides 3,5,7,11 has squared area = (3+5+7-11)(3+5-7+11)(3-5+7+11)(-3+5+7+11)/16 = 960.
		

Crossrefs

Programs

  • Mathematica
    lst = {}; Do[{a, b, c, d} = {Prime[n], Prime[n+1], Prime[n+2], Prime[n+3]}; A2=(a+b+c-d)(a+b-c+d)(a-b+c+d)(-a+b+c+d)/16; AppendTo[lst, A2], {n, 1, 100}]; lst

Formula

Area K of a cyclic quadrilateral with sides a, b, c, d is given by Brahmagupta's formula K = sqrt((s-a)(s-b)(s-c)(s-d)) where s = (a+b+c+d)/2.
Showing 1-5 of 5 results.