distribution of digits in prime numbers

565 Views Asked by At

I am curious about this: suppose we consider all numbers in base $b$ such that the number of digits $n$ in this range is the same ( eg, in base $10$ it could be $10-to-99$ for $n=2$, or $100-to-999$ for $n=3$, etc; leading digit is non-zero), for the prime numbers in this range, if I were to choose a prime number at random can I expect the distribution of the digits of my prime to be uniform random? That is, $\frac{n}{b}$.

Thank you.

2

There are 2 best solutions below

4
On

For any specific digit you can. In fact you can even show that a percentage of the digits are uniform.
A Theorem of Bourgain from which the above follows immediately says that

Let $n$ be large. Then there exists $\epsilon >0$ such that for any subset $I$ of $1,\ldots, n-1$ of size $\leq \epsilon n$ and for any choice of $a_i\in \{0,1\}$, $i\in I$, the number of primes $1\leq p\leq 2^n$ such that the $i$-th digit is $a_i$ for all $i\in I$ asymptotically equals to $\frac{2^{n-\#I}}{n\log 2}$ as $n\to \infty$.

(Here $\log =\log_{e}$. Also recall that the number of primes up to $2^n$ asymptotically equals to $\frac{2^n}{n\log 2}$.)

8
On

In an odd base, an odd number always has an odd number of odd digits.

Proof

$$\begin{eqnarray}(2n+1)+(2p+1)=2q \\ (2r+1)+(2s)=(2t+1) \\ (2u)+(2v)=(2w)\end{eqnarray}$$

By $$(x+y)+z=x+(y+z)\tag{4}$$ and $$a+c+d=a+d+c=c+a+d=c+d+a=d+a+c=d+c+a\tag{5}$$ we have $$\underbrace{(2h+1)+\cdots +(2h+1)}_{\text{2i+1 times}}=2e+1\implies (2i+1)(2h+1)=(2e+1)$$ $$ 123456789_b=1\cdot b^8+2\cdot b^7+3\cdot b^6+4\cdot b^5+5\cdot b^4 +6\cdot b^3+7\cdot b^2+8\cdot b^1 +9\cdot b^0$$ that in an odd (2h+1) base b, that all odd digits create odd summands. it follows from (1),(2)(3), that the even (2u) digits create even (2w) summands regardless of base.

even (2v) bases luck out in that $b^0=1\quad b\neq 0$. Otherwise, they couldn't represent odd (2r+1) numbers at all.

There are other things like all primes greater than 3 being 1 or 5 on division by 6, that can play with things. in a $6k+1$ base, then the last digit being $6j+4$, will force the rest of the digits to represent a number of forms $6l+1$ or $6m+3$ etc.