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.

A342720 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) and integer diagonals e,f.

This page as a plain text file.
%I A342720 #13 Apr 16 2021 00:12:59
%S A342720 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,1,3,1,2,2,3,1,4,2,4,2,5,3,7,1,2,
%T A342720 4,3,13,7,20,12,5,3,7,10,3,8,2,14,12,10,15,17,8,11,10,20,13,15,10,45,
%U A342720 9,18,25,46,38,18,2,25,20,30,18,32,17,32,43
%N A342720 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) and integer diagonals e,f.
%C A342720 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.
%e A342720 a(15)=1 because the only concave integer quadrilateral with longest edge length 15 has a=15, b=13, c=13, d=15 and diagonals e=4 and f=24. a(20)=3 because there are three solutions (a,b,c,d,e,f): (20,13,15,18,9,26), (20,13,13,20,11,24) and {20,15,15,20,7,24}.
%t A342720 an={};
%t A342720 he[a_,b_,e_]:=1/(2 e) Sqrt[(-((a-b-e) (a+b-e) (a-b+e) (a+b+e)))]
%t A342720 paX[e_]:={e,0} (*vertex A coordinate*)
%t A342720 pbX[a_,b_,e_]:={(-a^2+b^2+e^2)/(2 e),he[a,b,e]}(*vertex B coordinate*)
%t A342720 pc={0,0};(*vertex C coordinate*)
%t A342720 pdX[c_,d_,e_]:={(c^2-d^2+e^2)/(2 e),-he[c,d,e]}(*vertex D coordinate*)
%t A342720 concaveQ[{bx_,by_},{dx_,dy_},e_]:=If[by dx-bx dy<0||by dx-bx dy>(by-dy) e,True,False]
%t A342720 gQ[x_,y_]:=Module[{z=x-y,res=False},Do[If[z[[i]]>0,res=True;Break[],
%t A342720   If[z[[i]]<0,Break[]]],{i,1,4}];res]
%t A342720 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]]
%t A342720 Do[cnt=0;
%t A342720 Do[pa=paX[e];pb=pbX[a,b,e];pd=pdX[c,d,e];
%t A342720 If[(f=Sqrt[(pb-pd).(pb-pd)];IntegerQ[f])&&concaveQ[pb,pd,e]&&canonicalQ[{a,b,c,d}],cnt++
%t A342720 (*;Print[{{a,b,c,d,e,f},Graphics[Line[{pa,pb,pc,pd,pa}]]}]*)],
%t A342720 {b,1,a},{e,a-b+1,a-1},{c,1,a},{d,Abs[e-c]+1,Min[a,e+c-1]}];
%t A342720 AppendTo[an,cnt],
%t A342720 {a,1,75}
%t A342720 ]
%t A342720 an
%Y A342720 Cf. A340858 for trapezoids, A342721 for concave integer quadrilaterals with integer area.
%K A342720 nonn
%O A342720 1,17
%A A342720 _Herbert Kociemba_, Mar 19 2021