# Does every sequence of digits occur in one of the primes

I was triggered by the discussion "does every arbitrary digit sequence of length N occur in the decimals of Pi"

Although Pi is irrational and contains an infinite number of decimals, it seems that every sequence of N digits does not necessarily occur in Pi's decimals.

But I have another question, and I did not find any discussion about it. Does every sequence of N digits occur in at least one of the prime numbers.

So I am not asking if a certain prime number contains every possible sequence of N digits. To me it seems obvious that there does not exist such a prime number.

When N is small, it is obvious that every sequence will occur in at least one prime number. But when N gets larger, the prime numbers containing this sequence will become less.

Is there a largest N, where the sequence will not occur anymore in a prime number? Since the number of primes is infinite, so there will exist a prime number with an infinite number of digits (is that true?). So it is likely that every digit sequence will occur in at least one prime number. Is this something which can be proven?

• Do you have any proof that "every number sequence of N numbers does not necessarily occur in Pi's decimals"? – Mohammad Zuhair Khan Jan 20 '18 at 16:01
• @Mohammad One does not have to prove that something is not known to be true. At least, not mathematically. If you are aware of a result that says the converse, then this would be interesting indeed! – 57Jimmy Jan 20 '18 at 16:03
• Every finite sequence of digits occurs in infinitely many primes. That is a consequence of Dirichlet's theorem on primes in arithmetic progressions, and in a different way of the prime number theorem. (Dirichlet's theorem shows the sequence occurs infinitely often near the end of the prime's decimal [or other base] representation, the PNT shows it occurs infinitely often near the front.) Is that what you're asking? – Daniel Fischer Jan 20 '18 at 16:13
• @everyone, including moderators:stupid and obvious typos and spelling errors in my comment are a result of the rule that it is only allowed to edit a comment for 5 minutes. Not because I am too stupid to spot them or too lazy to correct them. – Hans Linkels Jan 21 '18 at 13:38
• I have edited the title and the contents. Now I am describing "sequence of digits", which is I think the correct expression. Thanks @Peter for pointing this out. – Hans Linkels Jan 21 '18 at 13:44

## 1 Answer

Theorem (Dirichlet): If $a,b\in \Bbb N$ with $\gcd (a,b)=1$ then the set $S(a,b)=\{na+b: n\in \Bbb N\}$ contains infinitely many primes.

For a sequence $(b_j)_{1\leq j\leq m}$ of decimal digits (with $m\in \Bbb N$) let $b=1+\sum_{j=1}^m b_j10^{m+1-j}$ and let $a=10^{m+1}.$ Then $S(a,b)$ contains infinitely many primes, and the sequence of decimal digits of every member of $S(a,b)$ contains the consecutive sub-sequence $(b_j)_{1\leq j\leq m}.$

For the purposes of this Q it is sufficient that $S(a,b)$ contains at least one prime, but it is easily shown that this is equivalent to Dirichlet's theorem, which is not easy to prove. It was one of the first (or the first) results in Number Theory whose proof used methods from Analysis.