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

A342721 a(n) is the number of concave integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n=Max(a,b,c,d), integer diagonals e,f and integer area.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 2, 0, 0, 0, 3, 1, 1, 0, 0, 1, 3, 0, 0, 0, 2, 1, 0, 6, 0, 4, 4, 2, 1, 0, 0, 1, 0, 0, 6, 0, 2, 8, 6, 2, 0, 1, 2, 0, 2, 0, 9, 0, 0, 2, 0, 13, 1, 0, 4, 0, 3, 0, 3, 5, 10, 11
Offset: 1

Views

Author

Herbert Kociemba, Mar 19 2021

Keywords

Comments

Without loss of generality we assume that a is the largest side length and that the diagonal e divides the concave quadrilateral into two triangles with sides a,b,e and c,d,e. Then e < a is a necessary condition for concavity. The triangle inequality further implies e > a-b and abs(e-c) < d < e+c.

Examples

			a(66)=1 because the only concave integer quadrilateral with longest edge length 66 and integer area has sides a=66, b=55, c=12, d=65, diagonals e=55, f=65 and area 1650.
		

Crossrefs

Cf. A340858 for trapezoids, A342720 for concave integer quadrilaterals with arbitrary area.

Programs

  • Mathematica
    an={};
    area[a_,b_,c_,d_,e_,f_]:=(1/4)Sqrt[(4e^2 f^2-(a^2+c^2-b^2-d^2)^2)]
    he[a_,b_,e_]:=(1/(2 e))Sqrt[(-((a-b-e) (a+b-e) (a-b+e) (a+b+e)))];
    paX[e_]:={e,0} (*vertex A coordinate*)
    pbX[a_,b_,e_]:={(-a^2+b^2+e^2)/(2 e),he[a,b,e]}(*vertex B coordinate*)
    pc={0,0};(*vertex C coordinate*)
    pdX[c_,d_,e_]:={(c^2-d^2+e^2)/(2 e),-he[c,d,e]}(*vertex D coordinate*)
    concaveQ[{bx_,by_},{dx_,dy_},e_]:=If[by dx-bx dy<0||by dx-bx dy>(by-dy) e,True,False]
    gQ[x_,y_]:=Module[{z=x-y,res=False},Do[If[z[[i]]>0,res=True;Break[],If[z[[i]]<0,Break[]]],{i,1,4}];res]
    canonicalQ[{a_,b_,c_,d_}]:=Module[{m={a,b,c,d}},If[(gQ[{b,a,d,c},m]||gQ[{d,c,b,a},m]||gQ[{c,d,a,b},m]),False,True]]
    Do[cnt=0;
    Do[pa=paX[e];pb=pbX[a,b,e];pd=pdX[c,d,e];
    If[(f=Sqrt[(pb-pd).(pb-pd)];IntegerQ[f])&&(ar=area[a,b,c,d,e,f]; IntegerQ[ar])&&concaveQ[pb,pd,e]&&canonicalQ[{a,b,c,d}],cnt++
    (*;Print[{{a,b,c,d,e,f,ar},Graphics[Line[{pa,pb,pc,pd,pa}]]}]*)],
    {b,1,a},{e,a-b+1,a-1},{c,1,a},{d,Abs[e-c]+1,Min[a,e+c-1]}];
    AppendTo[an,cnt],{a,1,75}
    ]
    an

A342722 a(n) is the number of convex integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n=Max(a,b,c,d) and integer diagonals e,f.

Original entry on oeis.org

0, 0, 0, 2, 2, 1, 5, 7, 8, 5, 7, 13, 14, 11, 15, 31, 18, 14, 18, 30, 25, 24, 22, 64, 42, 35, 51, 58, 34, 48, 37, 87, 71, 46, 69, 74, 51, 53, 74, 110, 53, 72, 61, 96, 106, 73, 60, 181, 102, 103, 125, 134, 79, 118, 133, 215, 141, 82, 82, 221
Offset: 1

Views

Author

Herbert Kociemba, Apr 25 2021

Keywords

Comments

Without loss of generality we assume that a is the largest side length and that the diagonal e divides the convex quadrilateral into two triangles with sides a,b,e and c,d,e. The triangle inequality implies e > a-b and abs(e-c) < d < e+c.

Examples

			a(6)=1 because the only convex integer quadrilateral with longest edge length 6 is a trapezoid with sides a=6, b=5, c=4, d=5 and diagonals e=f=7.
		

Crossrefs

Cf. A340858 for trapezoids, A342720 and A342721 for concave integer quadrilaterals, A342723 for convex integer quadrilaterals with integer area.

Programs

  • Mathematica
    an={};
    he[a_,b_,e_]:=1/(2 e) Sqrt[-(a-b-e) (a+b-e) (a-b+e) (a+b+e)];
    paX[e_]:={e,0} (*vertex A coordinate*)
    pbX[a_,b_,e_]:={(-a^2+b^2+e^2)/(2 e),he[a,b,e]}(*vertex B coordinate*)
    pc={0,0};(*vertex C coordinate*)
    pdX[c_,d_,e_]:={(c^2-d^2+e^2)/(2 e),-he[c,d,e]}(*vertex D coordinate*)
    convexQ[{bx_,by_},{dx_,dy_},e_]:=If[(by-dy) e>by dx-bx dy>0,True,False]
    (*define order on tuples*)
    gQ[x_,y_]:=Module[{z=x-y,res=False},Do[If[z[[i]]>0,res=True;Break[],If[z[[i]]<0,Break[]]],{i,1,6}];res]
    (*check if tuple is canonical*)
    canonicalQ[{a_,b_,c_,d_,e_,f_}]:=Module[{x={a,b,c,d,e,f}},If[(gQ[{b,a,d,c,e,f},x]||gQ[{d,c,b,a,e,f},x]||gQ[{c,d,a,b,e,f},x]||gQ[{b,c,d,a,f,e},x]||gQ[{a,d,c,b,f,e},x]||gQ[{c,b,a,d,f,e},x]||gQ[{d,a,b,c,f,e},x]),False,True]]
    Do[cnt=0;
    Do[pa=paX[e];pb=pbX[a,b,e];pd=pdX[c,d,e];
    If[(f=Sqrt[(pb-pd).(pb-pd)];IntegerQ[f])&&convexQ[pb,pd,e]&&canonicalQ[{a,b,c,d,e,f}],cnt++
    (*;Print[{{a,b,c,d,e,f},Graphics[Line[{pa,pb,pc,pd,pa}]]}]*)],
    {b,1,a},{e,a-b+1,a+b-1},{c,1,a},{d,Abs[e-c]+1,Min[a,e+c-1]}];
    AppendTo[an,cnt],{a,1 ,60}
    ]
    an

A342723 a(n) is the number of convex integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n=Max(a,b,c,d), integer diagonals e,f and integer area.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 2, 1, 1, 3, 1, 2, 0, 0, 4, 3, 0, 0, 4, 7, 2, 0, 5, 2, 5, 0, 1, 0, 3, 4, 3, 4, 0, 6, 7, 3, 4, 0, 3, 4, 0, 0, 5, 0, 9, 10, 9, 3, 0, 5, 8, 0, 4, 0, 17, 4, 0, 9, 1, 19, 2, 0, 6, 2, 7, 0, 7, 7, 7, 23, 2, 8, 12, 0, 10, 0, 5, 0, 15, 27
Offset: 1

Views

Author

Herbert Kociemba, Apr 25 2021

Keywords

Comments

Without loss of generality we assume that a is the largest side length and that the diagonal e divides the convex quadrilateral into two triangles with sides a,b,e and c,d,e. The triangle inequality implies e > a-b and abs(e-c) < d < e+c.

Examples

			a(4)=1 is the smallest possible solution and is a rectangle with a=c=4, b=d=3, e=f=5 and area 12. a(24)=4 includes the smallest possible solution with all sides a,b,c,d different and a=24, b=20, c=15, d=7, e=20, f=25 and area 234. Furthermore there are three rectangles with a=24,b=7, a=24,b=10 and a=24,b=18.
		

Crossrefs

Cf. A340858 for trapezoids, A342720 and A342721 for concave integer quadrilaterals, A342722 for convex integer quadrilaterals with arbitrary area.

Programs

  • Mathematica
    an={};
    area[a_,b_,c_,d_,e_,f_]:=1/4 Sqrt[4e^2 f^2-(a^2+c^2-b^2-d^2)^2];
    he[a_,b_,e_]:=1/(2 e) Sqrt[-(a-b-e) (a+b-e) (a-b+e) (a+b+e)];
    paX[e_]:={e,0} (*vertex A coordinate*)
    pbX[a_,b_,e_]:={(-a^2+b^2+e^2)/(2 e),he[a,b,e]}(*vertex B coordinate*)
    pc={0,0};(*vertex C coordinate*)pdX[c_,d_,e_]:={(c^2-d^2+e^2)/(2 e),-he[c,d,e]}(*vertex D coordinate*)
    convexQ[{bx_,by_},{dx_,dy_},e_]:=If[(by-dy) e>by dx-bx dy>0,True,False]
    (*define order on tuples*)
    gQ[x_,y_]:=Module[{z=x-y,res=False},Do[If[z[[i]]>0,res=True;Break[],If[z[[i]]<0,Break[]]],{i,1,6}];res]
    (*check if tuple is canonical*)
    canonicalQ[{a_,b_,c_,d_,e_,f_}]:=Module[{x={a,b,c,d,e,f}},If[(gQ[{b,a,d,c,e,f},x]||gQ[{d,c,b,a,e,f},x]||gQ[{c,d,a,b,e,f},x]||gQ[{b,c,d,a,f,e},x]||gQ[{a,d,c,b,f,e},x]||gQ[{c,b,a,d,f,e},x]||gQ[{d,a,b,c,f,e},x]),False,True]]
    Do[cnt=0;
    Do[pa=paX[e];pb=pbX[a,b,e];pd=pdX[c,d,e];
    If[(f=Sqrt[(pb-pd).(pb-pd)];IntegerQ[f])&&(ar=area[a,b,c,d,e,f]; IntegerQ[ar])&&convexQ[pb,pd,e]&&canonicalQ[{a,b,c,d,e,f}],cnt++
    (*;Print[{{a,b,c,d,e,f,ar},Graphics[Line[{pa,pb,pc,pd,pa}]]}]*)],{b,1,a},{e,a-b+1,a+b-1},{c,1,a},{d,Abs[e-c]+1,Min[a,e+c-1]}];
    AppendTo[an,cnt],{a,1,85}]
    an

A344528 a(n) is the number of integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n = Max(a,b,c,d) and integer diagonals e,f.

Original entry on oeis.org

0, 0, 0, 2, 2, 1, 5, 7, 8, 5, 7, 13, 14, 11, 16, 31, 20, 14, 19, 33, 26, 26, 24, 67, 43, 39, 53, 62, 36, 53, 40, 94, 72, 48, 73, 77, 64, 60, 94, 122, 58, 75, 68, 106, 109, 81, 62, 195, 114, 113, 140, 151, 87, 129, 143, 235, 154, 97, 92, 266
Offset: 1

Views

Author

Herbert Kociemba, May 22 2021

Keywords

Comments

This sequence is the sum of the sequences A342720 and A342722 which deal with concave and convex quadrilaterals respectively.

Examples

			a(6)=1 because the only integer quadrilateral with longest edge length 6 is a trapezoid with sides a=6, b=5, c=4, d=5 and diagonals e=f=7.
		

Crossrefs

Formula

a(n) = A342720(n) + A342722(n).

A344529 a(n) is the number of integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n = Max(a,b,c,d), integer diagonals e,f and integer area.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 2, 1, 1, 4, 1, 4, 0, 0, 6, 3, 0, 0, 7, 8, 3, 0, 5, 3, 8, 0, 1, 0, 5, 5, 3, 10, 0, 10, 11, 5, 5, 0, 3, 5, 0, 0, 11, 0, 11, 18, 15, 5, 0, 6, 10, 0, 6, 0, 26, 4, 0, 11, 1, 32, 3, 0, 10, 2, 10, 0, 10, 12, 17, 34
Offset: 1

Views

Author

Herbert Kociemba, May 22 2021

Keywords

Comments

This sequence is the sum of the sequences A342721 and A342723 which deal with concave and convex quadrilaterals respectively.

Examples

			a(4)=1 because the smallest possible quadrilateral is a rectangle with a=c=4, b=d=3, e=f=5 and area 12.
		

Crossrefs

Formula

a(n) = A342721(n) + A342723(n).

A371969 Perimeters of triangles with integer sides, which can be decomposed into 3 triangles that have a common vertex strictly inside the surrounding triangle and also integer sides.

Original entry on oeis.org

49, 50, 54, 64, 75, 78, 80, 88, 90, 91, 98, 100, 104, 108, 112, 117, 120, 121, 125, 126, 128, 133, 136, 140, 144, 147, 150, 156, 160, 162, 165, 168, 169, 170, 175, 176, 180, 182, 184, 188, 192, 195, 196, 198, 200, 203, 208, 210, 216, 220, 224, 225, 231, 234, 238, 240
Offset: 1

Views

Author

Klaus Nagel and Hugo Pfoertner, Apr 14 2024

Keywords

Examples

			a(1) = 49 is the perimeter of the first decomposable triangle with sides of the outer triangle [8, 19, 22], and sides meeting at the 4th "inner" vertex: 17, 6, 4. The 3 inner triangles have sides [8, 4, 6], [19, 17, 4], and [22, 6, 17].
		

References

  • These triangles can be viewed as degenerate tetrahedrons, in which all triangular inequalities for the faces are satisfied, and the Cayley-Menger determinant, which determines whether the 4th vertex yields a valid tetrahedron, takes the value 0.

Crossrefs

Programs

  • PARI
    H(a,b,c) = {my (s=(a+b+c)/2); s*(s-a)*(s-b)*(s-c)};
    CM(w1,w2,w3,v1,v2,v3) = matdet([0,1,1,1,1; 1,0,w3^2,w2^2,v1^2; 1,w3^2,0,w1^2,v2^2; 1,w2^2,w1^2,0,v3^2; 1,v1^2,v2^2,v3^2,0]);
    is_a371969(peri) = {forpart (w=peri, my (A=H(w[1],w[2],w[3]), epsA=1e-12); for (v1=1, w[3]-2, for (v2=w[3]-v1+1, w[3]-2, my (A3=H(w[3],v2,v1)); if (A3>=A, next); for (v3=1, w[3]-2, if (v3+v2<=w[1] || v3+v1<=w[2], next); my (A1=H(w[1],v2,v3)); if (A1>=A, next); my (A2=H(w[2],v1,v3)); if (A2>=A, next); my (C=CM(w[1],w[2],w[3],v1,v2,v3)); if (C==0 && abs(sqrt(A)-sqrt(A1)-sqrt(A2)-sqrt(A3)) < epsA,
    \\ print (peri," ",Vec(w)," ",[v1,v2,v3]);
    return(1))))), [1,(peri-1)\2], [3,3]); 0};
    for (n=3, 100, if (is_a371969(n), print1(n,", ")))
Showing 1-6 of 6 results.