# Square Modulo 3

## Theorem

Let $x \in \Z$ be an integer.

Then one of the following holds:

 $\ds x^2$ $\equiv$ $\ds 0 \pmod 3$ $\ds x^2$ $\equiv$ $\ds 1 \pmod 3$

### Corollary 1

Let $x, y \in \Z$ be integers.

Then:

$3 \divides \paren {x^2 + y^2} \iff 3 \divides x \land 3 \divides y$

where $3 \divides x$ denotes that $3$ divides $x$.

### Corollary 2

Let $x, y, z \in \Z$ be integers.

Then:

$x^2 + y^2 = 3 z^2 \iff x = y = z = 0$

### Corollary 3

Let $n \in \Z$ be an integer such that:

$3 \nmid n$

where $\nmid$ denotes non-divisibility.

Then:

$3 \divides n^2 - 1$

where $\divides$ denotes divisibility.

## Proof

Let $x$ be an integer.

Using Congruence of Powers throughout, we make use of:

$x \equiv y \pmod 3 \implies x^2 \equiv y^2 \pmod 3$

There are three cases to consider:

$(1): \quad x \equiv 0 \pmod 3$: we have $x^2 \equiv 0^2 \pmod 3 \equiv 0 \pmod 3$
$(2): \quad x \equiv 1 \pmod 3$: we have $x^2 \equiv 1^2 \pmod 3 \equiv 1 \pmod 3$
$(3): \quad x \equiv 2 \pmod 3$: we have $x^2 \equiv 2^2 \pmod 3 \equiv 1 \pmod 3$

$\blacksquare$