# Does there exist a $g$ such that $g$ is a primitive root modulo all primes not in $S$?

Let $g$ be a positive integer and $S$ be the set of prime divisors of $g$. Does there exist a $g$ such that $g$ is a primitive root modulo all primes not in $S$?

I was wondering about this, but it seemed hard to prove or disprove this because there are infinitely many primes. The condition that $g$ is taken modulo $p$ which is not a prime divisor of $g$ means that $g$ is invertible modulo $p$. How can solve this question?

• At first glance, this looks like an unsolved problem. – Lubin Feb 4 '17 at 2:35

By Dirichlet, there are infinitely many primes $p$ of the form $p=4gn+1$. By quadratic reciprocity, $g$ is a quadratic residue modulo $p$. So it's not a primitive root.
• It's about the relation between $p$being a square modulo $q$, and $q$ being a square modulo $p$. It's a bit of a long story, but you'll find it in every intro number theory textbook ever written, or just type "quadratic reciprocity" into the internet and stand back while 100,000 websites hit you. – Gerry Myerson Feb 4 '17 at 5:55