I recently discovered the Twitter account @*primes*. Every hour, they tweet the subsequent prime number. This made me wonder two things. First, what is the largest prime that you can tweet (in base-10 encoding in 140 characters).^{1} Second, how long until they get there.

Doing some quick calculations in Mathematica, I believe the largest 140 digit prime is the following:

9999999999999999999999999999999999999999999999

9999999999999999999999999999999999999999999999

999999999999999999999999999999999999999999999997

Wolfram Alpha confirms that this is prime and that the next prime is 141 characters.

As for how long it would take, recall that the number of primes less than $n$ is approximately $\frac{n}{\ln n}$. The number of primes less than $10^{141}$ is approximately

$$\pi(10^{140}) = \frac{10^{140}}{140\cdot \ln 10} = 3.1\cdot 10^{137}.$$

That’s $3\cdot 10^{57}$ times the estimated number of atoms in the universe. Looks like @*primes* should be able to tweet for a while.

The largest known prime is $2^{57,885,161} − 1$ and has 17,425,170 digits. ↩︎