On this page
Take an arithmetic progression such as 3, 7, 11, 15, 19 and so on. Does it hit primes forever? The answer rests on one check you can do in your head.
What does Dirichlet's theorem say?
Dirichlet's theorem states that for any two positive coprime integers a and d, there are infinitely many primes of the form a + nd (Dirichlet's theorem on arithmetic progressions). Peter Gustav Lejeune Dirichlet proved it in 1837, and it extends Euclid's theorem that there are infinitely many primes (same source).
The condition gcd(a, d) = 1 is the whole story. If a and d share a factor g greater than 1, then every term a + nd is a multiple of g, so at most one term can be prime. The progression 4k + 2 gives 2, 6, 10, 14, all even, so 2 is its only prime. A stronger form adds that, in the long run, the primes are shared evenly across the progressions with the same d whose first term is coprime to d (same source).
How are primes ending in 1, 3, 7 and 9 shared out below 1000?
Every prime other than 2 and 5 ends in 1, 3, 7 or 9, the only last digits coprime to 10, so it lies in one of the progressions 10k + 1, 10k + 3, 10k + 7 or 10k + 9. There are 168 primes below 1000, and we tallied them by last digit from the Prime Pages list of the first 1,000 primes:
Ending in 1: 40 primes
Ending in 3: 42 primes
Ending in 7: 46 primes
Ending in 9: 38 primes
That is 166, and with 2 and 5 it makes 168. An even split would be 41.5 each, and no digit is more than 4.5 away from it.
The small tilt has a name. Progressions whose remainder is not a square modulo d typically have slightly more primes than those whose remainder is a square, which is called Chebyshev's bias (Wikipedia summary; see also Rubinstein and Sarnak, Chebyshev's Bias, Experimental Mathematics, 1994). Modulo 10, the squares of numbers coprime to 10 end in 1 or 9, so 3 and 7 are the non-square remainders. Our count fits: 3 and 7 together have 88 primes, while 1 and 9 have 78.
Can you prove there are infinitely many primes of the form 4k + 3?
Dirichlet's full proof needs L-functions. One case has a short Euclid-style proof:
Suppose the primes of the form 4k + 3 are only p1, p2, ..., pr.
Build N = 4·p1·p2·...·pr − 1. Then N leaves remainder 3 when divided by 4, and N is odd.
Multiply any numbers of the form 4k + 1 and the product is still of the form 4k + 1. So N cannot be built only from primes of the form 4k + 1. It must have a prime factor q of the form 4k + 3.
q is not any of the pi. If it were, q would divide both 4·p1·...·pr and N, and so would divide their difference, 1.
So q is a new prime of the form 4k + 3, which contradicts step 1.
Worked example: start with 3, 7 and 11. Then N = 4 × 3 × 7 × 11 − 1 = 923 = 13 × 71. Here 13 = 4 × 3 + 1, while 71 = 4 × 17 + 3 is a new prime of the form 4k + 3.
Why not use the same trick for 4k + 1? Step 3 fails: two primes of the form 4k + 3 can multiply to a number of the form 4k + 1 (3 × 7 = 21). Those primes have their own story in our post on which primes are a sum of two squares.
How is Dirichlet's theorem different from Green–Tao?
The two results ask opposite questions. Dirichlet fixes a progression and asks whether it contains infinitely many primes. Ben Green and Terence Tao asked whether the primes contain progressions. In a paper first posted in 2004 and published in 2008, they proved that the primes contain arbitrarily long arithmetic progressions (Green and Tao, Annals of Mathematics, 2008; arXiv abstract).
How should you practise this for olympiads and JEE?
Check gcd(a, d) before anything else; it settles the trivial cases.
Redo the 4k + 3 proof from memory, then try 6k + 5 the same way (hint: use N = 6·p1·...·pr − 1).
See our posts on how many primes there are below a number and the still-open twin prime conjecture.
If a proof step loses you, the Fermi Problem Library has a step-by-step solver that explains the reasoning rather than just printing an answer. To revise coprimality and modular arithmetic first, try the Fermi Concept Library.



