/* AREXX program determining Pythagoras triangles with sides of integer length */ hyp = 1 addlib('rexxsupport.library', 0, -30, 0) addlib('rexxmathlib.library', 0, -30, 0) do forever hyp = hyp+1 /*A*/ hypsq=hyp**2 /*B*/ half = hyp/2 /*C*/ upp = int(half)+1 /*D*/ do side1 = 1 to upp /*E*/ side1sq = side1**2 /*F*/ side2sq = hypsq - side1sq /*G*/ side2 = sqrt(side2sq) /*H*/ intsid2 = int(side2) /*I*/ if intsid2=side2 then say ' ' intsid2 side1 hyp end end end