# How to plot a polynomial modulo a prime

I want to plot graphs of polynomials, and the solutions to equations, modulo a prime. So for example, for modulus 5 plot the graph of $x^2$, or the solutions to $x^2+y^2=2$, as subsets of $\mathbb{F}_5\times\mathbb{F}_5$. Of course I can do it by hand. And I can imagine ways to program it by generating and plotting lists but I have no experience programming, and since I do not really want many examples it might be the easiest for me to just do it by hand.

Does Mathematica have a command for this? Or are there examples on line doing it?

For example, the graph of $x^2$ modulo 7 contains the pairs

$\{0, 0\}, \{1, 1\}, \{2, 4\}, \{3, 2\}, \{4, 2\}, \{5, 4\}, \{6, 1\}$ and so it can be plotted by

ListPlot[{{0, 0}, {1, 1}, {2, 4}, {3, 2}, {4, 2}, {5, 4}, {6, 1}}]

Or again it might be nicer to represent the integers mod 7 by $\{-3,-2,-1,0,1,2,3\}$. And ListPlot with no further specifications does not produce very nice coordinate axes for this purpose since they have tick marks that make no sense as integers mod 7. If I keep working on it I'll get the job done but I wonder if someone has already got it well routinized.

• I don't very understant what you want to draw.Can you give a example by your hand? – yode Feb 26 '17 at 16:11

ListPlot[{x, y} /. Solve[x^2 + y^2 == 2, Modulus -> 10], 