In number theory, the sum of two squares theorem relates the prime decomposition of any integer n > 1 to whether it can be written as a sum of two squares, such that n = a2 + b2 for some integers a, b.An integer greater than one can be written as a sum of two squares if and only if its prime decomposition contains no factor pk, where prime and k is odd.