# Barban–Davenport–Halberstam theorem

In mathematics, the Barban–Davenport–Halberstam theorem is a statement about the distribution of prime numbers in an arithmetic progression. It is known that in the long run primes are distributed equally across possible progressions with the same difference. Theorems of the Barban–Davenport–Halberstam type give estimates for the error term, determining how close to uniform the distributions are.

## Statement

Let a be coprime to q and

$\displaystyle{ \vartheta(x;q,a) = \sum_{p\leq x \,;\, p \equiv a \bmod q} \log p \ }$

be a weighted count of primes in the arithmetic progression a mod q. We have

$\displaystyle{ \vartheta(x;q,a) = \frac{x}{\varphi(q)} + E(x;q,a) \ }$

where φ is Euler's totient function and the error term E is small compared to x. We take a sum of squares of error terms

$\displaystyle{ V(x,Q) = \sum_{q \leq Q} \sum_{a \bmod{q}} |E(x;q,a)|^2 \ . }$

Then we have

$\displaystyle{ V(x,Q) = O(Q x \log x) + O(x^2 (\log x)^{-A}) \ }$

for $\displaystyle{ 1 \leq Q \leq x }$ and every positive A, where O is Landau's Big O notation.

This form of the theorem is due to Gallagher. The result of Barban is valid only for $\displaystyle{ Q \leq x (\log x)^{-B} }$ for some B depending on A, and the result of Davenport–Halberstam has B = A + 5.