If p is a prime, and p≡1 mod 4, then
there exists 2 positive integers a and b such that a2+b2=p.
Without loss of generality, we can let a be an odd integer and b be an even
integer.
Pf:
(existence)
Since p≡1 mod 4,
there is a character χ of order 4. The value of χ is {1, i, -1, -i}. Thus the Jocabi sum J(χ,χ)=a+bi with
a, b integers. Using the fact that ∣J(χ,χ)∣2=p, we have a2+b2=p.
(uniqueness)
Let z=a+bi. If z=z1z2,
∣z∣2=∣z1∣2∣z2∣2=p, a prime, so either z1
or z2 is a unit. Let z1=m+ni belongs to Z[i] with mn≠0 and ∣z1∣2=m2+n2=p, and assume z2=x+yi/p with
x and y nonzero integers (the denominator p of z2 is by simple
calculation that z2=(a+bi)/(m+ni)=(a+bi)(m-ni)/p). Since p×z=z1×(x+yi), but p
and z are primes in Z[i] and Z[i] is a UFD, notice that z1=m+ni with
mn≠0, we have z1=z×u and x+yi=p×v, where u
and v are units in Z[i], that is u, v belongs to {1, i, -1, -i}. The uniqueness
of a and b up to conditions is proved.