Pythagorean theorem three sides in place of squares (squares are a special case, of course). The upper figure shows that for a scalene triangle, the area of the parallelogram on the longest side is the sum of the areas of the parallelograms on the other two sides, provided the parallelogram on the long side is constructed as indicated (the dimensions labeled with arrows are the same, and determine the sides of the bottom parallelogram). This replacement of squares with parallelograms bears a clear resemblance to the original Pythagoras's theorem, and was considered a generalization by Pappus of Alexandria in 4 AD The
Fermat's theorem on sums of two squares modulo 4, and none of them can be expressed as the sum of two squares. This is the easier part of the theorem, and follows immediately from the observation that all squares are congruent to 0 or 1 modulo 4. Albert Girard was the first to make the observation, describing all positive integral numbers (not necessarily primes) expressible as the sum of two squares of positive integers; this was published in 1625. The statement that every prime "p" of the form "4n+1" is the sum of two squares is sometimes called "Girard's theorem". For his part, Fermat wrote an elaborate