Which whole numbers are expressible as sums of two (integer) squares?
Here's a theorem that completely answers the question, due to Fermat:
A number N is expressible as a sum of 2 squares if and only if in the prime factorization of N, every prime of the form (4k+3) occurs an even number of times!
Examples: 245 = 5*7*7. The only prime of the form 4k+3 is 7, and it appears twice. So it should be possible to write 245 as a sum of 2 squares (in fact, try the squares of 14 and 7). But because 7 appears only once in 42=2*3*7, it is impossible to write 42 as the sum of two squares.
A corollary of this fact is that every prime of the form (4k+1) can be written as the sum of two squares.