Skip to main content
\( \newcommand{\lt}{ < } \newcommand{\gt}{ > } \newcommand{\amp}{ & } \)

Section8.2Powers

Let's continue to restrict ourselves to looking at \(\mathbb{Z}_p\), the integers modulo some prime \(p\), for a bit longer. This will enable us to get a little more detailed in our exploration. We eventually want to explore solutions to congruences modulo primes and prime powers.

Let's begin by exploring powers. Powers are particularly important, since polynomials are constructed from them. The following interact allows exploration of powers \(a^n\) modulo \(p\) for various primes \(p\) and bases \(a\). Notice I have not yet brought in the colors.

Do you see any patterns? It's probably a little early to try to come up with potential theorems, but there should be at least some patterns you see. Do you maybe even see any theorems we have already proved in here?

One of the biggest patterns is hard to see in this format, but is the simplest. Given a prime \(p\), you should get get the same answers for \(a\equiv a'\) (mod \(p\)). (This is the essence of the earlier proof about a polynomial not having only prime output, Fact 6.1.4.) So we should really just restrict ourselves to looking at \(0\leq a\lt p\).

Subsection8.2.1Returning to visualizing

Still, this is a lot of data to assimilate. Is there some way to think about it differently?

This next interact is super-cool, because it combines the short, color-coded format with the much less familiar material of powers.

The default coloring needs some explanation, as they are not the same as in the previous example. The \(a\) row and \(b\) column gives the color corresponding to \((a+1)^b\text{ (mod }p)\). That means the first (\(0\)th) column is the color for \(a^0=1\) and the second (\(1\)th) column gives the colors of each element \(a^1=a\) of \(\mathbb{Z}_p\). For instance, \((2,4)\) corresponds to \(3^4\equiv 4\) (mod \(7\)) in the initial example. Notice this color corresponds to the row 3, because of the numbering.

(As far as I know, this representation first appears in Wagon and Bressoud's excellent computational number theory text [C.3.7]. The PascGalois project has related visualizations.)

Sage note8.2.1Colorful options

If you don't like the colors, you can change the word in the quotes after the word 'cmap'; if you get rid of that, it will be a grayscale plot, which is most appropriate for vision-impaired users. Some others you could try are 'Oranges' or 'hsv' or … Well, see the next Sage cell if you really want to know all of them!

What color patterns can you see here? To say it another way, what potential theorems do you see? (Again, do you see any that we already have discussed?)

In a classroom or self-study situation, I strongly recommend thinking about this until coming up with some nice potential theorem regarding whether there are any patterns in \(a^b\) (mod \(p\)) that hold for all \(p\) or all \(a\) or all \(b\), or something.