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

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.


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).