7

I was just wondering, out of curiosity, do we know if there are more primes with even leading digits or odd leading digits? For example, primes with even leading digits would be $23$ or $29$ and primes with odd leading digits would be $31$ or $97$. If we haven't figured it out then how do we do something like that?

Thanks

Jeel Shah
  • 9,306
  • It's not clear what your definition is from your examples. Also, there are probably infinitely many primes of both types. Do you mean relative asymptotic densities? – not all wrong May 15 '13 at 14:06
  • @Sharkos I don't know exactly what an "relative asymptotic density" is but I would be guessing that is the case. I consider an even digit prime to be a prime that has an even digit as its first number. Similarly, an odd digit would be a prime that has an odd digit at the beginning. – Jeel Shah May 15 '13 at 14:08
  • I mean count the number of each type below all $n$ as $e_n,o_n$ and find the behavior of $e_n/o_n$ as $n\to\infty$. I don't know off the top of my head but it's probably 1 (: – not all wrong May 15 '13 at 14:13
  • $\frac{5}{9}$ of numbers less than $10^k$ have an odd leading digit, and I would expect approximately the same for primes. – Jonas Meyer May 15 '13 at 14:14
  • 1
    You can use the Prime Number Theorem to show that there more primes with a leading digit of 1,3,5,7 than there are those of 2,4,6,8 respectively. – Calvin Lin May 15 '13 at 14:15
  • 1
    Whoops, yes. Not many numbers start with 0, do they? Calvin Lin - can you elaborate? Does this distort the ratio or is this subleading? – not all wrong May 15 '13 at 14:17
  • 1
    Since $\pi (n) \sim \frac{x}{\ln x} $, the density (when defined properly) does decrease. The ratio is similar to the one obtained through Benford's law (which states that a number with leading digit d should appear $\log ( 1 + \frac{1}{d})$ times). However, I believe that the argument for prime numbers is much harder. – Calvin Lin May 15 '13 at 14:22
  • Suggestion - use PNT to estimate the number of primes with lead digit 1 in a particular range - ie lying between $10^k$ and $2 \times 10^k$ and similarly for other digits. Analysing numbers with the same number of digits might give a clue as to asymptotics. – Mark Bennet May 15 '13 at 15:59
  • @MarkBennet: all primes in that range start with a 1 – doetoe May 16 '13 at 14:18
  • @doetoe - precisely - so we can estimate how many there are. Then we can do the same with primes beginning with 2, 3, 4 etc. Then we can compute the ones with even leading digits, and the ones with odd leading digits. The answer by Charles suggests we may not have to be so sophisticated about it. I was just pointing out that there was a decent estimate available. – Mark Bennet May 16 '13 at 20:43

2 Answers2

9

The Prime Number Theorem can be used to find the supremum and infimum of the relative densities. In particular for primes starting with odd digits the upper bound is 7/9 = 0.777... (if you sample numbers starting 1999...) and the lower bound is 41/81 = 0.506... (if you sample numbers starting 8999...).


The supremum of a set is its least upper bound. For a finite set, a supremum is its maximum. For infinite sets, though, the supremum may be ("slightly") greater than all the members of the set. For example, the set $\{x:x<3\}$ has supremum 3 even though all members are less than 3. You can see that there is no maximum for this set, since if you choose some $y$ in the set it is less than $(3+y)/2$ which is less than 3, and so also in the set.

Similarly, the infimum is the greatest lower bound of the set, the generalization of the minimum.

What you might like in a situation like this would be the relative density of the primes starting with odd digits in the set of primes. This would be $$ \lim_{x\to\infty}\frac{\text{# of primes}\le x\text{ starting with an odd digit}}{\text{# of primes}\le x} $$

But what happens if this limit does not exist? For example, it might go up to 70%, then back down to 55%, then back up to 70%, and repeat ad infinitum. In fact this is precisely what happens!

So instead of looking for the limit, which does not exist (just like the maximum of $\{x:x<3\}$ does not exist), we look for the limit supremum and limit infimum. These always exist, and they are equal exactly when the limit exists (in which case they are equal to the limit).

But what is a limit supremum (lim sup for short)? In this case, it is $$ \lim_{y\to\infty}\sup_{x\ge y}\frac{\text{# of primes}\le x\text{ starting with an odd digit}}{\text{# of primes}\le x} $$ or in other words, the largest value that the function becomes arbitrarily close to infinitely often. (If it happened only finitely often, then it happens for the last time at some $y_0$, and the limit goes beyond $y_0$ to $\infty.$)

Of course the limit inferior (lim inf) is defined similarly with $\inf$ in place of $\sup.$

So much for the preliminaries. Now it's time to look at the Prime Number Theorem. It says that there are $(1+o(1))(x/\log x)$ primes below $x.$ The meaning of $o(1)$ is technical, but basically it's just some number that becomes arbitrarily small as $x$ increases. Now for some constant $0<\alpha<1$ the number of primes between $\alpha x$ and $x$ is $(1+o(1))(x/\log x) - (1+o(1))(\alpha x/\log(\alpha x))=(1+o(1))(1-\alpha)x/\log x.$ (The different $o(1)$ are actually different numbers, so they don't cancel the way you'd expect. The notation is funny, but that's the way it's usually written.)

So basically there are just the number of primes you'd expect between $\alpha x$ and $x$ since the logarithm in the density grows so slowly.

Now we can use this to derive the densities we need. First, let's look at the relative density of the odd-starting primes between $10^{n-1}$ and $10^n.$ 5/9 start with an odd digit and 4/9 start with an even digit, since by the above use of the Prime Number Theorem the densities are what we'd expect. Now you can do the same with the primes between $10^{n-2}$ and $10^{n-1}$, etc., so for the primes below $10^n$ you have 5/9 starting with an odd digit.

But we don't want to restrict ourselves to looking just at powers of 10. What if we looked at numbers below $2\cdot10^n$? Then half would be below $10^n$ of which 5/9 would start with an odd digit, and the half between $10^n$ and $2\cdot10^n$ all start with odd digits. Thus (5/9+1)/2 = 7/9 start with odd digits. It's not hard to see that this is the best you can do.

Similarly, on the other side, if you look at $9\cdot10^n$ you have nine groups: the ones below $10^n$ have 5/9 odd first digits, the $n-$digit ones starting with 1, 3, 5, or 7 are all odd-initial, and the $n-$digit ones starting 2, 4, 6, 8 are all even-initial. Overall that's (5/9+4)/9 = 41/81. And we're done!

Charles
  • 32,122
  • Can you please go a little more in-depth into the supremum and infimum and explain relative densities. I'm not familiar with these concepts. – Jeel Shah May 15 '13 at 14:47
  • @gekkostate: You can find arbitrarily large numbers where about 77.7% of the primes up to that point start with odd numbers, and arbitrarily large numbers where about 50.6% of the numbers up to that point start with odd numbers. For numbers less than 41/81 or more than 7/9 you can't do the same (though you can for any numbers between the two). – Charles May 15 '13 at 14:55
  • A little. I would still like more detail in the question. I am willing to offer a bounty for it when it is available. – Jeel Shah May 15 '13 at 19:53
  • @gekkostate: I have increased the length of my answer by a factor of ~10. I hope this helps. – Charles May 16 '13 at 14:57
  • Wow, this was excellently written and explained. Very easy to understand, thanks a bunch! A bounty will certainly be awarded. – Jeel Shah May 16 '13 at 16:46
  • One could also pose a more delicate question such as how many primes have a certain configuration in their first m digits. In the original question m was 1. the prime number theorem would apply and the reason for this would be that m is considered to be fixed all along. The PNT would yield a similar result with an upper and lower bound. – Mr. No May 19 '13 at 00:06
  • Continuation: It might therefore be interesting to estimate the following function which is defined for all $m\leq \log_{10}x:$ $F(x,m):=U(x,m)-L(x,m)$ where U and L denote the upper and lower limits as x and $m=m(x)$ both tend to infinity. Perhaps for fixed x and $m_2(x)>m_1(x)$ one can show that $F(x,m_2)<F(x,m_1)$, i.e.as m grows then the gap between the diferrent limits is smaller,but this seems like a strictly computational rather than mathematical issue so I will not pursue this further. – Mr. No May 19 '13 at 00:13
  • @CaptainDarling: Yes, this would not be hard. Basically the primes grow slowly enough that such questions have the same answer for the primes as for the natural numbers. – Charles May 20 '13 at 19:52
1

One could expect that the Benford's law applies here (as Calvin Lin comments also noted), though I seems quite difficult (if possible) to prove it. Assuming that, primes starting with an odd digit would be have a relative population of 60.9%

Update: here's a relevant paper

leonbloy
  • 63,430
  • Not with asymptotic density, though. You'd need to use something more sophisticated like logarithmic density. – Charles May 15 '13 at 14:55