Maths WorkshopMaths problems with full solutions
Exercise 338Number theory › CongruencesL1Added 31 Oct 2026

Sums of two squares modulo 4

#congruences#squares

Statement

Show that no integer of the form 4k+34k+3 is a sum of two squares of integers.

Hint

Find the possible remainders of a square modulo 44.

Show solutionHide solution

Solution

Let mm be an integer. If m=2jm=2j, then m2=4j2≡0(mod4)m^2=4j^2\equiv0\pmod4. If m=2j+1m=2j+1, then m2=4j(j+1)+1≡1(mod4)m^2=4j(j+1)+1\equiv1\pmod4. So a square is ≡0\equiv0 or 1(mod4)1\pmod4.

A sum of two squares is therefore congruent to 0+0=00+0=0, 0+1=10+1=1 or 1+1=21+1=2 modulo 44, never to 33. Hence 4k+34k+3 is never a sum of two squares.