%I #4 Jan 11 2021 22:35:04
%S 0,0,0,0,1,0,0,2,1,1,0,2,1,1,4,2,3,1,4,5,3,7,4,6,8,7,10,6,12,7,10,16,
%T 12,16,10,18,18,16,25,18,24,24,26,30,24,36,26,34,40,36,44,34,49,45,46,
%U 58,49,60,46,64,67,61,78,64,79,83,82,91,79,101,82,99,112,103
%N Number of distinct integer-sided convex quadrilaterals with perimeter n whose largest two sides form a right angle.
%F a(n) = Sum_{k=1..floor(n/4)} Sum_{j=k..floor((n-k)/3)} Sum_{i=j..floor((n-j-k)/2)} (2 - [k = j])*(-1 + sign(ceiling((k+j)/sqrt((n-i-j-k)^2 + i^2)))), where [ ] is the Iverson bracket.
%e The notation [q,r,s,t] below shows the order in which the sides are joined (counterclockwise) starting with the largest side q, the second largest side r, and then each of the possible orders in which s and t can occur.
%e a(4) = 1; [1,1,1,1] a square.
%e a(5) = 0; ( not [2,1,1,1] since sqrt(2^2+1^2) = sqrt(5) > 1+1 = 2. )
%e a(7) = 2; [2,2,2,1], [2,2,1,2].
%e a(14) = 4; [5,3,3,3], [4,4,4,2], [4,4,3,3], and [4,4,2,4].
%t Table[Sum[Sum[Sum[(2 - KroneckerDelta[k, j]) Sign[Ceiling[(j + k)/Sqrt[(n - i - j - k)^2 + i^2]] - 1], {i, j, Floor[(n - j - k)/2]}], {j, k, Floor[(n - k)/3]}], {k, Floor[n/4]}], {n, 0, 80}]
%K nonn
%O 0,8
%A _Wesley Ivan Hurt_, Jan 09 2021
|