Find $x^2 \pmod p$ for all the least positive residues of the following.
In each case plot the graph of $x$ against $x^2 \pmod p$ for:
(a) $p= 5$
(b) $p= 17$
(c) $p= 19$
For each of these primes $p$ solve $x^2 \equiv 2 \pmod p$ and the equivalent quadratic Diophantine equation
$$x^2 = 2 + py$$
(a) The following table shows the values of $x^2 \pmod 5$.
| x | x^2 mod 5 |
| 1 | 1 |
| 2 | 4 |
| 3 | 4 |
| 4 | 1 |
The following is a plot of $x^2 \pmod 5$ against $x$.
The table and graph show the congruence $x^2 \equiv 2 \pmod 5$ has no solutions, and so the quadratic Diophantine equation $x^2 = 2 + 5y$ has no solutions.
(b) The following table shows the values of $x^2 \pmod {17}$.
| x | x^2 mod 17 |
| 1 | 1 |
| 2 | 4 |
| 3 | 9 |
| 4 | 16 |
| 5 | 8 |
| 6 | 2 |
| 7 | 15 |
| 8 | 13 |
| 9 | 13 |
| 10 | 15 |
| 11 | 2 |
| 12 | 8 |
| 13 | 16 |
| 14 | 9 |
| 15 | 4 |
| 16 | 1 |
The following is a plot of $x^2 \pmod {17}$ against $x$.
The table and graph shows the congruence $x^2 \equiv 2 \pmod 5$ has solutions $x \equiv 6 \pmod {17}$ and $x \equiv 11 \pmod {17}$.
Using $y=\frac{x^2-2}{17}$, the solutions to the Diophantine equation $x^2 = 2 + 17y$ are $(x,y) = (6,2)$ and $(x,y) = (11,7)$.
(c) The following table shows the values of $x^2 \pmod {19}$.
| x | x^2 mod 19 |
| 1 | 1 |
| 2 | 4 |
| 3 | 9 |
| 4 | 16 |
| 5 | 6 |
| 6 | 17 |
| 7 | 11 |
| 8 | 7 |
| 9 | 5 |
| 10 | 5 |
| 11 | 7 |
| 12 | 11 |
| 13 | 17 |
| 14 | 6 |
| 15 | 16 |
| 16 | 9 |
| 17 | 4 |
| 18 | 1 |
The following is a plot of $x^2 \pmod {19}$ against $x$.
The table and graph show the congruence $x^2 \equiv 2 \pmod {19}$ has no solutions, and so the quadratic Diophantine equation $x^2 = 2 + 19y$ has no solutions.


