[Math] Explanation of a regular pattern only occuring for prime numbers

group-theorynumber theoryvisualization

Consider multiplication group tables modulo $n$ with entries $k_{ij} = (i\cdot j)\ \%\ n$ visualized according to these principles:

  • Colors are assigned to numbers $0 \leq k \leq n$ from

    • $\color{black}{\textsf{black}}$ for $k=0$ over

    • $\color{red}{\textsf{red}}$ for $k=\lfloor n/4\rfloor$ and

    • $\color{silver}{\textsf{white}}$ for $k=\lfloor n/2\rfloor$ and

    • $\color{blue}{\textsf{blue}}$ for $k=\lfloor 3n/4\rfloor$ back to

    • $\color{black}{\textsf{black}}$ for $k = n$

  • Sizes are assigned to numbers $0 \leq k \leq n$ by

    • $\textsf{1.5}$ if $k=\lfloor n/4\rfloor$ or $\lfloor 3n/4\rfloor$

    • $\textsf{1.0}$ otherwise

  • Positions are shifted by $(n/2,n/2)$ modulo $n$ to bring $(0,0)$ to the center of the table.

Visualized this way, you will occasionally find (for some $n$) highly regular multiplication group tables like these (with $n=12,20,28,44,52,68$):

enter image description here

My question is:

Why do these patterns occur exactly when $n = 4p$ with a prime number $p$?


Find here some examples for $n \neq 4p$, e.g. $n=61, 62, 63, 64$:

enter image description here


Here for some other prime numbers: $n = 4\cdot 31 = 124$ and $n = 4\cdot 37 = 148$:

enter image description here


One may observe that for $n = 4m$ and $x,y = m$ or $x,y = 3m$ the "size 1.5" dots are systematically separated by $0$ (= black) and $n/2$ (= white) dots, i.e. that there are only and exactly $4$ values along these lines.

enter image description here


For the sake of completeness: the multiplication group table modulo $8 = 4\cdot 2$ (which also qualifies, but not so obviously):

enter image description here

Best Answer

If $n=4p$, then for $xy \equiv p$ or $3p$ mod $n$ you need $p$ to divide $x$ or $y$ but $2$ to divide neither: thus the "size $1.5$" dots are all on the lines $x = p$, $x = 3p$, $y = p$ and $y = 3p$.