(Reminder of factorization)

Find all integer pairs $(x, y)$ that are solutions to the equation $x^{2}=7+y^{2}$.
$x^{2}=7+y^{2} \Longleftrightarrow x^{2}-y^{2}=7 \Longleftrightarrow(x-y)(x+y)=7$

$x+y$ and $x-y$ are therefore associated divisors of 7.

By solving the systems, we obtain 4 solutions: $(4,3),(4,-3),(-4,-3),(-4,3)$.

## Squares modulo $n$

## Definition 4.

An integer $a$ is a square modulo $n$ if there exists $b$ such that $a \equiv b^{2}[n]$.

Not all numbers are squares modulo $n$, which allows us to solve certain exercises by finding a contradiction.

For example, we should remember that:

- A square is always congruent to 0 or 1 modulo 4.
- A square is always congruent to 0 or 1 modulo 3.
- The cubes modulo 7 are $0,1,-1$.

## Proof:

Let's make a table of congruences modulo 4:

| $n[4]$ | 0 | 1 | 2 | 3 |
| :---: | :---: | :---: | :---: | :---: |
| $n^{2}[4]$ | 0 | 1 | $4 \equiv 0$ | $9 \equiv 1$ |

Similarly, we get the following table for squares modulo 3:

| $n[3]$ | 0 | 1 | 2 |
| :---: | :---: | :---: | :---: |
| $n^{2}[3]$ | 0 | 1 | $9 \equiv 0$ |

For cubes modulo 7:

| $n[7]$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $n^{3}[7]$ | 0 | 1 | 8 | 27 | 64 | 125 | 216 |
| $n^{3}[7]$ | 0 | 1 | 1 | -1 | 1 | -1 | -1 |

## Example 5.

Show that if $(x, y, z)$ is a solution to the equation $x^{2}+y^{2}=z^{2}$, then $x$ or $y$ is a multiple of 2.

We look at the equation modulo 4. If $x$ and $y$ are both odd, then $x^{2} \equiv y^{2} \equiv 1$ so $z^{2} \equiv 2$. But a square is never congruent to 2 modulo 4. Contradiction.