
A function that represents all primes - olvy0
https://en.wikipedia.org/wiki/Formula_for_primes#A_function_that_represents_all_primes
======
naniwaduni
Doesn't this just encode a list of all the primes in a real number, then
define a function which extracts each subsequent value? This seems exactly
equivalent to defining an array of primes and a function which indexes that
array, and passing that off as a function representing all primes. That we can
multiplex datagrams into a stream isn't particularly novel.

~~~
notfashion
Representing an arbitrary sequence of bits, digits, etc. using a real number
is the basis for arithmetic coding. As such, it's an approach that has been
productive historically, and arithmetic coding continues to be widely used. So
the basic idea of encoding whatever you want to encode in a single real number
(obviously represented to just enough precision) isn't fruitless and boring.
In this case it is a number that is easy to calculate using the formula given,
which doesn't at first glance resemble a prime sieve.

~~~
naniwaduni
It is exactly like arithmetic coding. The formula given allows you to improve
the precision of the constant given by encoding more primes, and it equally
well lets you encode integers that are not prime. It doesn't resemble a prime
sieve because it's not one; you just construct approximations with existing
knowledge of what the primes are.

------
AlEinstein
In a sense, this function isn't that interesting; It's just a way of encoding
the prime numbers into a real number.

However, one interesting aspect is how efficiently this particular function
works for the prime numbers. The function doesn't work for Fibonacci numbers,
for example.

Still, it takes 113 bits to encode the primes up to 100, which can trivially
be encoded with 100 bits so...

------
klingonopera
I was somewhat disappointed to not find Riemann's hypothesis, the Zeta
function or even complex numbers involved...

[https://theconversation.com/has-one-of-maths-greatest-
myster...](https://theconversation.com/has-one-of-maths-greatest-mysteries-
the-riemann-hypothesis-finally-been-solved-103974)

[https://www.sciencemag.org/news/2018/09/skepticism-
surrounds...](https://www.sciencemag.org/news/2018/09/skepticism-surrounds-
renowned-mathematician-s-attempted-proof-160-year-old-hypothesis)

