# Prime constant

The prime constant is the real number ${\displaystyle \rho }$ whose ${\displaystyle n}$th binary digit is 1 if ${\displaystyle n}$ is prime and 0 if n is composite or 1.

In other words, ${\displaystyle \rho }$ is simply the number whose binary expansion corresponds to the indicator function of the set of prime numbers. That is,

${\displaystyle \rho =\sum _{p}{\frac {1}{2^{p}}}=\sum _{n=1}^{\infty }{\frac {\chi _{\mathbb {P} }(n)}{2^{n}}}}$

where ${\displaystyle p}$ indicates a prime and ${\displaystyle \chi _{\mathbb {P} }}$ is the characteristic function of the primes.

The beginning of the decimal expansion of ρ is: ${\displaystyle \rho =0.414682509851111660248109622\ldots }$ (sequence A051006 in the OEIS)

The beginning of the binary expansion is: ${\displaystyle \rho =0.011010100010100010100010000\ldots _{2}}$ (sequence A010051 in the OEIS)

## Irrationality

The number ${\displaystyle \rho }$ is easily shown to be irrational. To see why, suppose it were rational.

Denote the ${\displaystyle k}$th digit of the binary expansion of ${\displaystyle \rho }$ by ${\displaystyle r_{k}}$. Then, since ${\displaystyle \rho }$ is assumed rational, there must exist ${\displaystyle N}$, ${\displaystyle k}$ positive integers such that ${\displaystyle r_{n}=r_{n+ik}}$ for all ${\displaystyle n>N}$ and all ${\displaystyle i\in \mathbb {N} }$.

Since there are an infinite number of primes, we may choose a prime ${\displaystyle p>N}$. By definition we see that ${\displaystyle r_{p}=1}$. As noted, we have ${\displaystyle r_{p}=r_{p+ik}}$ for all ${\displaystyle i\in \mathbb {N} }$. Now consider the case ${\displaystyle i=p}$. We have ${\displaystyle r_{p+i\cdot k}=r_{p+p\cdot k}=r_{p(k+1)}=0}$, since ${\displaystyle p(k+1)}$ is composite because ${\displaystyle k+1\geq 2}$. Since ${\displaystyle r_{p}\neq r_{p(k+1)}}$ we see that ${\displaystyle \rho }$ is irrational.