Binary Weights of Primes – Parities of Binary Weights of Primes

nt.number-theoryprime numbers

Let $X$ denote the sequence A200246: an $i$-th element of $X$ is equal to $w(p_i) \bmod 2$, where $w(p_i)$ is the number of ones in the base-$2$ representation of an $i$-th prime.

The first $564163$ bits of $X$ (corresponding to all primes less than $2^{23}$) contain $274615$ zeros and $289548$ ones.

The first $1077871$ bits of $X$ (corresponding to all primes less than $2^{24}$) contain $520574$ zeros and $557297$ ones.

It seems that the prevalence of ones is too visible to be ignored. How to explain this? What is the value of $$\lim_{n \to \infty} \frac{f_0(n)}{f_1(n)},$$ where $f_b(n)$ denotes the number of elements with value $b$ in the initial bits of $X$ corresponding to all primes less than $2^{n}$ for a positive integer $n > 1$ (if this value converges)?

Best Answer

Mauduit and Rivat showed that the sum of the binary digits of primes are equally distributed between the possibilities $0\bmod 2$ and $1\bmod 2$. So the limit you want is $1$. More generally they consider the distribution $\bmod q$ of the sums of digits of primes written in any base $b$.

Related Question