Published May 31, 2021
[
 
]
First let's show that any integer square leaves remainder 0 or 1 on division by 4
An integer can be either odd or even, so we can represent it as \(2k\) or \(2k + 1\), the square of them will be \(4k^2\) or \(4k^2 + 4k + 1\), it is clear that the remainder on division by 4 is either 0 or 1.
Now assume both \(a\) and \(b\) are odd, then \(c = a^2 + b^2 = 8k^2 + 8k + 2\), whose remainder on 4 is 2, which contradicts our previous proof.
References: Mathematics and Its History, Third Edition By John Stillwell