OFFSET
1,1
COMMENTS
The area of the right triangle is a rational number = p1*p2/2. Forming the right triangle and the diagonal d is the only way we can analytically determine the area of an irregular tetragon knowing just the sides.
FORMULA
Let p1, p2, p3, p4 be the consecutive prime sides of a tetragon with p1, p2 forming a right angle. Then the diagonal d, connecting the end points of p1 and p2 divides the tetragon into right triangle p1, p2, d and triangle p3, p4, d. The sum of the areas of these triangles is the area of the right tetragon. Let s1, s2 = semiperimeters of the right triangle and the other triangle. Then s1 = (p1+p2+d)/2, s2=(p3+p4+d)/2. Since p1, p2, d is a right triangle, d can be determined as d = sqrt(p1^2+p2^2). Then knowing d we know all sides of the two triangles forming the tetragon and can therefore determine their area together which is the area of the tetragon. AreaQ = sqrt(s1(s1-p1)(s1-p2)(s1-d)) + sqrt(s2(s2-p3)(s2-p4)(s2-d)).
PROG
(PARI) \prime sided quadrilaterals with 2 smallest primes the rays of a right angle. quadlatpr(n) = { local(x, d, area, s1, s2, a1, a2, p2, p3, p4); for(x=1, n, p1=prime(x); p2=prime(x+1); p3=prime(x+2); p4=prime(x+3); if(p1+p2+p3 > p4, d=sqrt(p1^2+p2^2); s1 = (p1+p2+d)/2; s2 = (p3+p4+d)/2; a1 = p1*p2/2; a2 = sqrt(s2*(s2-p3)*(s2-p4)*(s2-d)); area = a1+a2; ); print1(floor(area)", ") ) }
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Apr 16 2005
STATUS
approved