Sorry if this question is too simple.


I once read, on a number theory textbook - forget the title, in one of the problems list that all Pythagorean triplets when multiplied are divisible by 60.


I proved that using the generating functions (is this the correct name? I got the name from my Discrete Mathematics textbook):


\begin{align}
a &= p^2 - q^2 \\\
b &= 2pq \\\
c &= p^2 + q^2.
\end{align}


I proved it by proving all possible parities of $p$ and $q$. It's tedious because I have to prove some cases are not possible (like $a$, $b$, and $c$ can't be all even or odd).


My questions are:


1. Who and how someone came up with the generating functions?
2. If you don't know the generating functions or don't want to prove it like I did, is there any other way to prove it? Geometrically? Using Calculus? I mean there're many ways to prove Pythagorean theorem using Geometry, Number Theory, etc.



Proof of "if $a^2 + b^2 = c^2$ then $abc$ is divisible by 60"
1. Generating functions is not really the right name. I would say "parameterization."
2. These formulas were known to the Babylonians. The simple proof goes as follows: assume WLOG that a, b, c are relatively prime. Since a, b, c cannot all have the same parity, WLOG b, c have different parity. Then a^2 = (c + b)(c - b) where the factors on the RHS are odd and relatively prime (use the Euclidean algorithm), so they must both be squares, say p^2 and q^2 (use unique prime factorization.) Then c = p^2 + q^2, b = p^2 - q^2, and this gives a = 2pq.
3. It's equivalent to showing that abc is divisible by 3, 4, 5. This is straightforward if you know that squares are congruent to 0, 1 mod 3, congruent to 0, 1 mod 4, and congruent to 0, 1, 4 mod 5 because 1 + 1 != 1 mod 3 or mod 4 and 1 + 1, 1 + 4, and 4 + 4 are not equal to 1 or 4 mod 5. This implies that two squares which are not divisible by 3, 4, 5 cannot sum to a square which is not divisible by 3, 4, 5.


