Primes That Leave a Remainder of 1 When Divided by 4
📂Number TheoryPrimes That Leave a Remainder of 1 When Divided by 4
Theorem
Let p=2 be a prime number.
For some a,b∈Z, p≡1(mod4) ⟺ p=a2+b2
Explanation
While excluding p=2, in fact, since it is 2=12+12, it’s not a big deal to include it in the theorem.
For example, 13≡1(mod4) is
13=4+9=22+32
37≡1(mod4) is
37=1+36=12+62
61≡1(mod4) is
61=25+36=52+62
These facts are interesting on their own but also have a deep connection with Gaussian primes, elevating number theory to a higher level.
Proof
(⟹)
Part 1.
Since p≡1(mod4), for some k∈N, it can be represented as p=4k+1.
Euler’s Criterion: a2p−1≡(pa)(modp)
By Euler’s criterion,
(p−1)≡(−1)2(4k+1)−1≡(−1)2k≡1(modp)
therefore, −1 is a quadratic residue in p, and there exists c∈Z satisfying c2≡−1(modp). Multiplying both sides by B2 and rearranging gives
(cB)2+B2≡0(modp)
Letting A:=(cB), for some M∈Z
A2+B2=Mp
and
M=pA2+B2≤p(p−1)2+12=p−p2p−2<p
thus M<p. Continuously reducing this M to M=1 means for some a,b∈Z, p=a2+b2 can be said.
Part 2. 1≤r<M
Consider u,v∈Z satisfying
u≡A(modM)v≡B(modM)−2M≤u,v≤2M
(for example, if M=13 and A≡10(mod13), then u≡−3(mod13), so their existence is always assured). Then, since A2+B2=pM in Part 1,
u2+v2≡A2+B2≡0(modM)
and for some r∈Z, u2+v2=rM. Also,
r=Mu2+v2≤M(M/2)2+(M/2)2=2M<M
thus r<M.
Assuming r=0, since {0=u≡A(modM)0=v≡B(modM), A,B must be a multiple of M, and A2+B2 must be a multiple of M2. That is, M must be a multiple of p, but since M<p is shown in Part 1, this is impossible, and r must be at least greater than 0. Summarizing, 1≤r<M.
Part 3.
According to the Cauchy-Schwarz inequality,
====≡≡(u2+v2)(A2+B2)u2A2+v2A2+u2B2+v2B2(u2A2+2uAvB+v2B2)+(v2A2−2uAvB+u2B2)(uA+vB)2+(uA−vB)2(uA−vB)BA−AB(modM)0(modM)
thus (uA−vB) is a multiple of M. Also, since (uA+vB)≡AA+BB≡0(modM) in the above Part 2, (uA+vB) is also a multiple of M.
Part 4.
Since A2+B2=Mp and u2+v2=Mr,
(u2+v2)(A2+B2)=M2rp
and using the Cauchy-Schwarz inequality,
(uA+vB)2+(uA−vB)2=M2rp
is obtained. Since (uA+vB) and (uA−vB) are multiples of M in the above Part 3, dividing both sides by M2 gives
(MuA+vB)2+(MuA−vB)2=rp
Defining a new
A2:=(MuA+vB)B2:=(MuA−vB)M2:=r
for this gets us back to
A22+B22=M2p
Therefore, this Ak,Bk,Mk for k∈N has the same properties defined in Parts 1~3.
Since r<M in the above Part 2, Mk decreases as k increases, stopping exactly at M=1.
(⟸)
Since p=a2+b2 is odd, a and b cannot both be even or odd.
Let’s say for some n,m∈Z, a:=2n+1, b=2m. Then,
p===a2+b24n2+4n+1+4m24(n2+n+m)+1
thus, p≡1(mod4).
■
By applying the Cauchy-Schwarz inequality and adding a few more conditions, a similar corollary can also be obtained for natural numbers.
Corollary
For odd m, the remainder when dividing all prime factors by 4 is 1, or for even m, if 2m is odd and the remainder when dividing all prime factors of 2m by 4 is 1 ⟺ gcd(a,b)=1 for some a,b∈Z, then m=a2+b2
See Also