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.
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
Keywords
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
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
Comments