Image for Theorem of Niven

Theorem of Niven

Theorem of Niven states that a positive integer \( N \) can be written as the sum of two squares if and only if in its prime factorization, every prime of the form \( 4k + 3 \) occurs with an even exponent. In simpler terms, to determine if a number is the sum of two squares, look at its prime factors: primes like 3, 7, 11, etc., which are 3 more than multiples of 4, must appear in even powers. If they do, the number can be expressed as the sum of two squares; if not, it cannot.