Skip to main content
2 of 4
added 841 characters in body
Mastrem
  • 458
  • 4
  • 10

Explanation for the sum of primitive roots modulo $p$ (taken from $[-(p-1)/2,(p-1)/2]$) being positive way more often than being negative?

An earlier version of this question received a few upvotes but no answers on math.stackexchange.


For $p$ an odd prime, let $S(p)$ denote the sum of the primitive roots modulo $p$, taken from $\left[-\frac{p-1}2,\frac{p-1}2\right]$.

When $p\equiv 1\pmod 4$, we have $S(p)=0$. When $p\equiv 3\pmod 4$, the situation is more interesting. If the primitive roots were 'randomly distributed,' in the sense that the multiplicative property which defines them has no bearing on their additive properties (vague, yes, I know), one would expect $S(p)$ to be negative about as often as it is positive.

However, numerical experiments suggest that for all sufficiently large $n$, $$ \frac{\#\{p\le n:S(p)>0\}}{\#\{p\le n:S(p)<0\}}>2. $$ On the other hand, certain more specific residue classes seem to contain way more primes $p$ with $S(p)<0$. For example, there are just three primes $p\le 2\cdot 10^5$ with $p\equiv 11\pmod{24}$ and $S(p)>0$. These are $65171$, $116243$ and $190331$.

Questions: Is there some explanation for this phenomenon? Perhaps even a way to compute limits of the form $$\lim_{n\to\infty}\frac{\#\{p\le n:p\equiv a\pmod{m},S(p)<0\}}{\#\{p\le n:p\equiv a\pmod{m},S(p)>0\}}?$$ Do these limits even exist?

EDIT: Based on Terry Tao's suggestion (and Greg Martin's, in a comment on my original post), I've tried to account for the known bias quadratic non-residues have. Let $S_2(p)$ denote the sum of the quadratic non-residues modulo $p$, taken from $\left[-\frac{p-1}2,\frac{p-1}2\right]$. Instead of comparing $S(p)$ to $0$, we'll compare $S(p)$ to $S_2(p)$. At first glance, the bias seems to disappear. I found $$ \begin{align*} \#\left\{p\le 10^5 :p\equiv 3\pmod 4, S(p)>S_2(p)\right\}&=2574;\\ \#\left\{p\le 10^5 :p\equiv 3\pmod 4, S(p)<S_2(p)\right\}&=2220. \end{align*} $$ However, in more specific residue classes, it is clearly still there. For example: $$ \begin{align*} \#\left\{p\le 10^5 :p\equiv 11\pmod {24}, S(p)>S_2(p)\right\}&=170;\\ \#\left\{p\le 10^5 :p\equiv 11\pmod {24}, S(p)<S_2(p)\right\}&=1033. \end{align*} $$

Mastrem
  • 458
  • 4
  • 10