Skip to main content
4 of 4
deleted 19 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. $$ 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*} $$

EDIT 2: On second thought, comparing to $S_2(p)$ may not be the most natural way of removing the bias quadratic non-residues have. Fix a prime $p$ with $p\equiv 3\pmod 4$ and let $X$ be a uniformly distributed random variable on $[-(p-1)/2,(p-1)/2]$. Is there a significant difference between $$ \mathbb{P}\left(X\text{ prim. root} | \left(\frac Xp\right)=-1,X<0\right) \quad\text{and}\quad \mathbb{P}\left(X\text{ prim. root} | \left(\frac Xp\right)=-1,X>0\right)? $$ Experimentally, it seems there is. Up to $10^4$, there are $619$ primes $p$ with $p\equiv 3\pmod 4$ and for $600$ of these, there are more primitive roots among the negative quadratic non-residues.

Mastrem
  • 458
  • 4
  • 10