This problem can be solved by a short computer program as follows:

10 $D=0$

20 FOR $C = 1$ TO $99$

30 FOR $B = 1$ TO $C$

40 FOR $A = 1$ TO $B$

50 IF $A^2 + B^2 = C^2$ PRINT $A$, $B$, $C$

60 IF $A^2 + B^2 = C^2$ $D = D + 1$

70 IF $A^2 + B^2 = C^2$ AND $A*B = A+B+C$ PRINT ``Area is half perimeter for '';$A$,$B$,$C$

80 NEXT $A$

90 NEXT $B$

100 NEXT $C$

110 PRINT ``Total number is ''; $D$

120 END

You can check for yourself that, when you put integer values of $P$ and $Q$ into the formulas $A=2PQ$, $B=P^2 - Q^2$ and $C=P^2 + Q^2$, you get $A^2 + B^2 = C^2$. The formulas give infinitely many Pythagorean triples.

Can you find $P$ and $Q$ such that $A=9$, $B=40$ and $C=41$? Play a game with a friend. Each choose integer values of $P$ and $Q$ and calculate $A$, $B$ and $C$. Then give your opponent just the values of $A$, $B$ and $C$. The winner is the first one to find $P$ and $Q$.

It needs to be proved that all Pythagorean triples come from values of $P$ and $Q$ in this way. Look out for future articles with some proofs and showing how to derive these formulas.

10 $D=0$

20 FOR $C = 1$ TO $99$

30 FOR $B = 1$ TO $C$

40 FOR $A = 1$ TO $B$

50 IF $A^2 + B^2 = C^2$ PRINT $A$, $B$, $C$

60 IF $A^2 + B^2 = C^2$ $D = D + 1$

70 IF $A^2 + B^2 = C^2$ AND $A*B = A+B+C$ PRINT ``Area is half perimeter for '';$A$,$B$,$C$

80 NEXT $A$

90 NEXT $B$

100 NEXT $C$

110 PRINT ``Total number is ''; $D$

120 END

You can check for yourself that, when you put integer values of $P$ and $Q$ into the formulas $A=2PQ$, $B=P^2 - Q^2$ and $C=P^2 + Q^2$, you get $A^2 + B^2 = C^2$. The formulas give infinitely many Pythagorean triples.

Can you find $P$ and $Q$ such that $A=9$, $B=40$ and $C=41$? Play a game with a friend. Each choose integer values of $P$ and $Q$ and calculate $A$, $B$ and $C$. Then give your opponent just the values of $A$, $B$ and $C$. The winner is the first one to find $P$ and $Q$.

It needs to be proved that all Pythagorean triples come from values of $P$ and $Q$ in this way. Look out for future articles with some proofs and showing how to derive these formulas.