40 comments

[ 3.0 ms ] story [ 74.7 ms ] thread
I wonder what the longest known streak of identical digits is in pi. Also, does the sequence 0123456789 happen any in location of the known digits of pi?
There's a sequence of thirteen eights, and twelve of each of the other digits, documented at [0] which covers the first 2.7 trillion digits. Based on that you can be all but certain any given ten-digit sequence, including 0123456789, has also been found.

[0] https://bellard.org/pi/pi2700e9/pidigits.html

It surely does appear somewhere. But it isn't within the first 2 billion digits.
I dunno about "known" but you can get a billion digits pretty easy.

  $ wget https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt
  $ grep -ob 012345678 pi-billion.txt
  956753746:012345678
  $ grep -ob 0123456789 pi-billion.txt
  $ 
So close, and amusingly close to the end of the file!
I love how Wikipedia contains these weird little nuggets of knowledge, and I love how they keep showing up on Hacker News.
Somewhat related:

https://github.com/philipl/pifs

If the expansion of pi is normal then all your data is already in it

And you can compress any data as the index at which it occurs in pi!!!1!
Can the index be reliably represented in fewer bytes than the data itself?
this question is equivalent to asking a physicist about a machine, ‘but can it reliably do more work than you put in to it?’

The equivalent of the law of thermodynamics in this case is the pigeonhole principle.

In fact, no compression scheme can reliably compress data to fewer bytes than it started as, thanks to the pigeonhole principle.
Nope. On average it takes much more information to represent the index than the data itself. "Compress" is definitely a misnomer here.
(comment deleted)
Is there a proof that says that any arbitrary finite sequence of digits will appear somewhere in the digits of pi? Are there finite sequences known to never appear?
Wow, your question led to some Wikipedia research on my end, and I found this:

'In particular, the popular claim "every string of numbers eventually occurs in π" has not been proven.'

I think I claimed this before. Oops!

Quote from https://en.m.wikipedia.org/wiki/Normal_number.

It's a common misconception
The probability that that's the case is 1, but that's not the same as a proof.
Not in digits of pi necessarily (needs a proof), but indeed in any truly random character sequence with independent probabilities of characters; you can easily calculate the probability of it, exponentially decreasing with number of characters in the desired sequence.
would be cool to have the same thing for other bases
I wondered the same thing, surprised it wasn’t mentioned in the Wikipedia article.
Yeah. It doesn't seem like pi is meant to be base10
This kind of trivia is my favorite thing to find on HN
The digits "360" are centered at the 360th digit. [Edit: if you include the leading 3 before the decimal, which Wikipedia doesn't.]
Gets me thinking about then ending of the book version of Contact.
All my passwords are conveniently stored in the constant Pi
Now I'm adding √-1 to all my passwords.
Now that's one complex password, I'd imagine.
Hmmm, on second thought, maybe i shouldn't be involved.
Pi is conjectured[1], though not proved, to be normal. If true (likely), we can expect to find Moby Dick in its entirety somewhere in 𝛑, along with tomorrow's news of the day. Eventually, we'll find a string of digits nnnn....nnnn that's going to be longer than the number of particles in our universe. Of course, there's also a lot of gibberish.

[1] http://info.sjc.ox.ac.uk/users/gualtieri/Is%20Pi%20normal.ht...

Yes, there's no mathematical significance, but finding such a thing so early is emotionally intriguing to some humans, myself included.
The people who produced 800-1160-digit approximations of pi before computers ... back in the late 1940s (e.g. Wrench & Smith) ... used electro-mechanical calculators (e.g. Marchant). That (doomed) technology is well-documented here: http://www.vintagecalculators.com/