Extend binary represented number to prime

49 Views Asked by At

Given a bitstring $w \in \{0,1\}^*$, is there always a extension $x\in\{0,1\}^*$, such that the number binary represented by wx is a prime number? I.e. \begin{align*} \exists x : \Sigma_{i=|x|+1}^{|w|+|x|} 2^i \cdot w_i + \Sigma_{i=0}^{|x|} 2^i\cdot x_i \text{ is a prime} \end{align*}

Stated otherwise, can we turn every natural number into a prime by sequences of doubling and doubling+1?

The problem may also be generalized to an arbitrary base instead of 2.

1

There are 1 best solutions below

1
On

This is no definite answer, but may be one in a few years.

I'm lazy and define $n10110$ as appending $10110$ to the binary representation of n.

The ratio of max and min number we can get is $\frac{n1111111...}{n0000000...} = \frac{2^{k}n+2^{k}-1}{2^{k}n}$ (appending k 1s and 0s).

The Oppermann conjecture states: "For every integer $x > 1$, there is at least one prime number between $x(x − 1)$ and $x^{2}$ and at least another prime between $x^{2}$ and $x(x + 1)$."

That means the ratio of two primes is at most $\frac {x(x+1)-1}{x^{2}+1}$, as $x^{2}$ and $x(x+1)$ aren't prime themselves.

$$\frac{2^{k}n+2^{k}-1}{2^{k}n} > \frac {n(n+1)-1}{n^{2}+1}$$ $$\iff (2^{k}n+2^{k}-1)(n^{2}+1) > (n(n+1)-1)(2^{k}n) $$ $$\iff 2^{k}n^{3}+2^{k}n^{2}-n^{2}+2^{k}n+2^{k}-1 > 2^{k}n^{3}+2^{k}n^{2}-2^{k}n $$ $$\iff 2^{k}-1 > n^{2} $$

So if given an $n$ we just chose $k$ so that $2^{k}-1 > n^{2} $ and we're guaranteed that there is a prime in range $n0000000...$ to $n1111111...$ as the span we cover with those two numbers is bigger than the span in which at least one prime is guaranteed to appear.

The only issue is, that the Oppermann conjecture is NOT proven yet, however it is very likely that it is true, so I'd answer your question with a '99.999% yes' as well.