190k views
2 votes
Show that if n is an integer then n^2 ≡ 0 or 1 (mod 4).

User Kipzes
by
7.7k points

1 Answer

3 votes

Final answer:

If n is an integer, n^2 will be equal to either 0 or 1 when taken modulo 4.

Step-by-step explanation:

To show that if n is an integer then n^2 ≡ 0 or 1 (mod 4), we need to consider the possible remainders when n is divided by 4.

If n is divisible by 4, then n can be written as 4k, where k is an integer.

In this case, n^2 = (4k)^2 = 16k^2, which is also divisible by 4.

Therefore, n^2 ≡ 0 (mod 4).

If n is not divisible by 4, then n = 4k + r, where r is the remainder when n is divided by 4, and k is an integer.

Squaring both sides, we get n^2 = (4k + r)^2 = 16k^2 + 8kr + r^2.

The remainder when n^2 is divided by 4 depends on the remainder r^2 when r is divided by 4.

If r is 0 or 2, then r^2 ≡ 0 (mod 4), and n^2 ≡ 0 (mod 4).

If r is 1 or 3, then r^2 ≡ 1 (mod 4), and n^2 ≡ 1 (mod 4).

User Mona Jalal
by
8.4k points