16 ms·
A function that represents all primes
- naniwaduni 7y agoDoesn'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.
- duskwuff 7y agoI'm reminded of the formula whose graph is an image of the formula: https://en.wikipedia.org/wiki/Tupper%27s_self-referential_formula https://en.wikipedia.org/wiki/Tupper%27s_self-referential_fo...
- naniwaduni 7y agoIt's not even as interesting as that.
- notfashion 7y agoRepresenting 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.
- rlpb 7y ago> In this case it is a number that is easy to calculate using the formula given It appears to me that the formula given requires pre-existing knowledge of the list of primes in order the expand the series.
- naniwaduni 7y agoIt 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.
- klingonopera 7y agoI 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-mysteries-the-riemann-hypothesis-finally-been-solved-103974 https://theconversation.com/has-one-of-maths-greatest-myster... https://www.sciencemag.org/news/2018/09/skepticism-surrounds-renowned-mathematician-s-attempted-proof-160-year-old-hypothesis https://www.sciencemag.org/news/2018/09/skepticism-surrounds...
- AlEinstein 7y agoIn 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...