TITLE: How to find sequence of digits in pi?
QUESTION [7 upvotes]: I saw this project on github https://github.com/philipl/pifs, where they are trying to compress files in the pi number after the decimal. I guess this makes sense because apparently every finite sequence of digits exist in the never ending decimal numbers of pi. But I am trying to understand 1 step of their process.
So firstly from what I understand, if you want to compress a file, that is really represented in a sequence of numbers like say 471947...2846 (somehow gotten from base 16). Then, they assume that sequence is somewhere in pi.
They somehow then look up where the sequence starts in pi. This is the step I don't understand how they do. But they use a formula called Bailey–Borwein–Plouffe formula to do it. 
So the compression is really two numbers $<A,B>$, where A is the index of the start number of pi, and B is the length needed.
To uncompress, its just a for loop, loop through every index from A, and repeat B times, and use that formula, to get the pi digit value, then convert it back to binary, and you have the original file again.
But it's that first step to find that initial start index using the formula I don't understand how that's done. Surely they don't brute force and try every combination in a linear fashion. 
Does anyone know?
Thanks

REPLY [3 votes]: The Bailey-Borwein-Plouffle formula does not allow you to find a desired sequence of digits in $\pi$.  As the Wikipedia page says, it allows you to find the hex digits starting as a desired place without calculating the preceding ones.  So if you want the digits of $\pi$ starting at the billionth, this is your friend. This would be used in the decryption step.  
It is not proven that every digit sequence appears in $\pi$, but it is likely.  I am not aware of any way besides brute force to find were a given sequence occurs.  The problem with the idea is that the index for your file is likely to be as long as the file.  Yes, instead of storing your file you store the index, but it is just as large and harder to use.  Suppose you have a file that is $1000$ hex digits long. There are $16^{1000}$ sequences of $1000$ hex digits, so you would expect your string to occur somewhere around position $16^{1000}$, which takes $1000$ hex digits to store.  At this page you can search the first $200,000,000$ decimal digits of $\pi$ for a desired string. If you look for $12345678$, it reports that it occurs at position $186557266$, which is $9$ digits instead of $8$