# Is the number of primes congruent to 1 mod 6 equal to the number of primes congruent to 5 mod 6?

(I know that there's an infinity of primes congruent to 5 mod 6, but I don't know if there is an infinity of primes congruent to 1 mod 6.)

But what I'd really like to know is whether or not the number of primes ≡1 mod 6 less than a given n can be said to be asymptotically equal to the number of primes ≡5 mod 6 less than that n. So the "total" number of primes ≡1 mod 6 would be equal to the number of primes ≡5 mod 6.

(I hope this is understandable. I'd also like to know how to phrase this inquiry in a more standard fashion, if someone would tell me how to fix it.)

-
You might ask like this: let $\pi_1(n)$ be the number of primes of the form $6k+1$ that are less than $n$, and $\pi_5(n)$ similarly. Then you can ask whether $\pi_1(n)/\pi_5(n)$ approaches a limit as $n$ increases without bound, and if so, whether that limit is 1. – MJD Aug 22 '12 at 1:13
That's precisely what I mean; thank you. – Annick Aug 22 '12 at 1:14
(You didn't ask for this, but for an elementary proof that there are infinitely many primes congruent to $1 \bmod 6$, consider the possible primes dividing a number of the form $k^2 - k + 1$.) – Qiaochu Yuan Aug 22 '12 at 1:28
Got it, thanks. Great to know. – Annick Aug 22 '12 at 2:35

Yes, this is true. A more general statement follows from a suitably strong form of Dirichlet's theorem on arithmetic progressions, namely that asymptotically the proportion of primes which are congruent to $a \bmod n$ (for $\gcd(a, n) = 1$) is $\frac{1}{\varphi(n)}$.

In the particular case that $n = 6$ it is possible to give a more elementary proof of a weaker result. Define the Dirichlet L-function

$$L(s, \chi_6) = \sum_{n=1}^{\infty} \frac{\chi_6(n)}{n^s}$$

where $\chi_6$ is the unique nontrivial Dirichlet character $\bmod 6$. This takes the form $\chi_6(n) = 1$ if $n \equiv 1 \bmod 6$, $\chi_6(n) = -1$ if $n \equiv 5 \bmod 6$, and $\chi_6(n) = 0$ otherwise. The Euler product of this L-function is

$$L(s, \chi_6) = \prod_p \left( \frac{1}{1 - \chi_6(p) p^{-s}} \right) = \prod_{p \equiv 1 \bmod 6} \left( \frac{1}{1 - p^{-s}} \right) \prod_{p \equiv 5 \bmod 6} \left( \frac{1}{1 + p^{-s}} \right).$$

It is possible to explicitly evaluate $L(1, \chi_6)$ and in particular to show that it is not zero; in fact,

$$L(1, \chi_6) = \int_0^1 \frac{1 - x^5}{1 - x^6} \, dx$$

and this can be evaluated using partial fractions (but note that the integrand is always positive so this number is definitely positive). So we conclude that

$$-\log L(s, \chi_6) = \sum_{p \equiv 1 \bmod 6} \log (1 - p^{-s}) + \sum_{p \equiv 5 \bmod 6} \log (1 + p^{-s})$$

approaches a nonzero constant as $s \to 1$ (if summed in the appropriate order) even though the first and second terms separately approach $\mp \infty$. So the contributions coming from primes in each residue class cancel out asymptotically. This is not quite as strong as the desired statement, though; if you fill in all the details in what I've said you'll show that the Dirichlet density of the primes congruent to $\pm 1 \bmod 6$ are the same but this should still be true for the natural density and this requires a further argument (I am not sure how much further, though).

For more details see any book on analytic number theory, e.g. Apostol.

-
Thanks so much for this highly detailed answer and explanatory links. – Annick Aug 22 '12 at 1:27

Look up "prime races" at http://www.dms.umontreal.ca/~andrew/PDF/PrimeRace.pdf.

Their conclusion: "It does seem that “typically” qn + a has fewer primes than qn + b if a is a square modulo q while b is not."

So, since 1 is a quadratic residue mod 6, while 5 is not, there will typically be more primes of the form 6n+5 than 6n+1 (though their ratio does tend to 1).

-