# Evaluate the sum $P=\sum_{n=1}^\infty \frac{a_n}{2^n}$.

Question: Let ${\{a_n}\}$ be the sequences of $0$s and $1$s, such that $a_n=1$ if $p$ is a prime number, otherwise $a_n=0$. So, ${\{a_n}\}={\{0,1,1,0,1,0,1,0,0,0,1,...}\}$. Evaluate the sum

$P=\sum_{n=1}^\infty \dfrac{a_n}{2^n}$.

Incomplete answer: I can just see some lower and upper bound for $P$. If every $a_n$ was $1$ the sum was $1$; first term is $0$ so upper bound reduces to $\frac{1}{2}$; since even numbers greater than two are not primes thus the upper bound reduces to $\frac{1}{2}-\frac{1}{16}-\frac{1}{64}-...=\frac{1}{2}-\frac{1}{12}=\frac{5}{12}$. We can do this for $3(n+1)$, $5(n+1)$ and so on, but since we have infinite prime numbers, this method doesn't seem to be a proof. First lower bound is $0$, BTW.

• I don't think there would be a closed form to the solution. (I am not sure). You can find an approximation by using the fact that prime counting funtion at a number $x$ is given by $\pi(x)\approx \frac{x}{\ln x}$ – AvZ Feb 1 '15 at 9:24

It will be impossible to evaluate (find a closed form) this sum, because it's the Prime Constant. You can read more about its value at Wikipedia or Mathworld, if you wish.

By the way: $(a_n)\neq (0,1,1,0,0,0,1,0,0,0,1,...)$, but $(a_n) = (0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, ...)$.

• Thank you. I haven't heard of that, it just came to mind to be interesting such a sum. – user210902 Feb 1 '15 at 9:26

Apart from $2$ and $3$, primes can be found only in the residue classes $\{1,5\}\pmod{6}$, so the value of the prime constant $\rho$ is upper bounded by: $$\frac{1}{2^2}+\frac{1}{2^3}+\sum_{k=1}^{+\infty}\left(\frac{1}{2^{6k+1}}+\frac{1}{2^{6k-1}}\right)=\frac{1}{4}+\frac{1}{8}+\frac{5}{126}<\color{red}{\frac{5}{12}}=0.416\ldots$$ and more careful estimations can be carried out by extending the sieving process to the primes $\{2,3,5\}$, i.e. to the residue classes $\!\!\pmod{30}$ and so on, leading to: $$\rho < \color{red}{\frac{209}{504}} = 0.414682529\ldots$$

• It is funny to notice that $\rho$ is just a bit greater than $\sqrt{2}-1$. – Jack D'Aurizio Feb 1 '15 at 12:26