7² mod 8
49 = 6·8 + 1
1.
Every perfect square leaves remainder 0 or 1 when divided by 4, and every odd square leaves remainder 1 when divided by 8: and for odd .
This page is easier if you are comfortable with:
An even number is , so its square is divisible by 4. An odd number is , so its square is ; since is always even, the square is , which leaves remainder 1 on division by 8. The idea of remainders comes from linear congruences, and the pattern of odd and even numbers is in even, odd and consecutive numbers.
The result is used to prove that some numbers are not squares: any number of the form or is not a square, and any odd number that is 3, 5 or 7 mod 8 is not a square. It also limits sums of two squares, because the remainders of mod 4 can only be 0, 1 or 2, a fact used in the sum of two squares theorem.
The same idea explains why one leg of a Pythagorean triple is always even, and relates to other residue rules such as the digit sum rule and the rule for 11. A deeper tool is Euler's theorem.
Squares leave very few remainders, so remainders can prove that a number is not a perfect square.
Only the remainders 0 and 1 ever appear, so 2 and 3 are impossible.
These examples are worked by hand, step by step, so you can compare your own working.
Find modulo 8.
Show that 2023 is not a perfect square.
Show that 1997 is not a perfect square.
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
49 = 6·8 + 1
1.
36
0.
81
1.
25
1.
Every square is ≡ 0 or 1 (mod 4); every odd square is ≡ 1 (mod 8). These constraints rule out many Diophantine equations.
Odd square.
Even square.
Odd square.
Odd square.
possible ✗
never ✓
Only 0, 1.
always 0 ✗
0 or 4 ✓
2² = 4, 4² = 0.
3 ✗
1 ✓
Always 1.
sometimes ✗
check mod 3 instead ✓
Different modulus.
Try each one on paper, then open the answer. Use the solver above to see the full working.
1
0
1
4
1
0
Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Solve: …
0 or 1.
1.
(2k + 1)² = 4k(k + 1) + 1 and k(k + 1) is even.
To show equations like a² + b² = 4c + 3 have no solutions.
sum of two squares theorem.
Pythagorean triples.
More in Discrete maths and number theory and the formula sheets.