The Pi-Search Page

twitter bird logoShare on Twitter

News [more]

2020 Rewrite: The Pi searcher is now written in Rust.

2013-05-19 Huge overhaul: The pi searcher is now interactive. It searches as you type. There may be some bugs - let us know.

11/7/2011 - We created a Google Plus account. So much for that, eh?

Why the Pi Searcher?

In 1996, Arthur Bebak of the now-defunct Netsurfer Digest jokingly suggested the idea. I put the site online, linked from the also now-defunct Useless Web Pages Pages. The original suggestion was to find your birthday in Pi, but things got out of hand. The original pi searcher featured 1.25 million digits. It was upgraded in 1998 to 50 million, in 2001 to 100 million, and in 2005, to 200 million digits to keep up with the times. The Pi Searcher has proven both exceptionally useless (see the comments below) and occasionally useful to math & early science classes.

Picture of Math Mug
Math mug!


Pi shower curtain

How it Works

The Pi Searcher uses a combination of linear search (searching each digit one by one) for small search strings and a pre-computed index for large search strings. The result is that the Pi searcher is extremely fast -- it takes less than 1/50th of a second to handle most requests. For more information, see how the Pi Searcher works.

Finding Pi

See our new Digits of Pi page for even more digits...

I'm frequently asked where people can get such a ridiculously large amount of pi. Be warned that 50 million digits of pi takes up 50 megabytes. This can take up to 4 hours to download with a 28.8k modem!

DigitsSource
Small bits of Pi Angio.net: 10 50 100 500 1000 10000 100000
1 Million 1 million digits of Pi from angio.net (1m digits after the 3.)
1.25 Million Project Gutenberg
Up to 51 billion University of Tokyo They are not publicly available past 4.2B. See the README file for details.
50 million - COMPRESSED BINARY angio (my digits) Packed 2 digits per byte, NOT for human consumption. Here is a hastily written unix-only decompression program. It requires mmap, and I've only tested it on BSD.

I've verified the digits in my 200 million against the sources listed above, and believe them to be correct. If there's an error, however, please notify me by emailing dga - at - pobox DOT com and I'll upgrade.

You can find the source code to the pi searcher here in tar.gz format.

Chances of Finding Your Number in Pi

Why can/can't I find my number in Pi? If we view Pi as a big, random string of numbers (which is close enough for our purposes), then we can figure out the odds of finding any string in the first 100 million digits of Pi:

Number Length Chance of Finding
1-5100%
6Nearly 100%
799.995%
863%
99.5%
100.995%%
110.09995%

Happily, if you include the zeros, birthdays are 8 digits long -- so you have a 63% chance of finding your birthday in the first 100 million digits of pi. Now that we're to 200 million, the odds are up to 86%, so it'll be a while before everyone can find their birthday in Pi.

I've also posted a more in-depth explanation of the probability of finding strings in Pi for people who are curious.

Pi Numeric Trivia Bits

Self-locating Strings in Pi
(Thanks to Jeff Roulston for the impetus behind this bit of Pi trivia, and to Colin Rose for supplying the 4th string).

Pi contains a few self-locating strings, but not many. Defining self-locating depends how you count the "position". If you treat the first digit after the decimal point as digit "1" (which the pi searcher does), then you get the following numbers which can self-locate themselves in the first 100M digits of pi:

1, 16470, 44899, 79873884

If, on the other hand, you act like a computer geek and use zero based indexing, then you get these numbers:

6, 27, 13598, 43611, 24643510

The Meaning of Life (42) and Pi
(Quoting from Scott Glazer): Trying to come up with a significant number to search for, I thought of 42 (the answer to life, the universe, and everything in Hitchhikers's Guide to the Galaxy.) 42 would be way too common of course, so I went for 424242. Came back that this shows up at position 242423. Add one (for the decimal point, I lamely rationalize here) and you get 242424, the reverse of the original input. Now that's meaningful... or something.

[Editors Note] Amusingly enough, the entire string returned is 242424242. If you disregard either of the ending twos, you find that it's the same position at which you find 42424242. Ahh, the palindromic possibilities inherent in a reversible meaning of life string. --Dave

Repeating Patterns in Pi

Jonathan Day recently (02/1999) noticed that there appear to be no simple, repeating patterns longer than 10 digits. He found 9 6's at 45681781, 9 7's at 24658601 and 9 8's at 46663520. There are also the above mentioned 42's. Can you find something else?

How many digits to find a birthday?

Many thanks to Carola Schermuly, who prompted me to figure out a most useless (but interesting) bit of Pi trivia: The maximum number of digits of Pi necessary to find any month-day combination is 60872. Interestingly enough, this is the same value with European date formats (1203 meaning March 12th) and American date formats - the same date, December 3rd, is the winner. It takes 60872 digits after the decimal point to find them.

Loop Sequences within Pi

Dan Sikorski pointed out an interesting loop sequence within Pi. If you search for 169, it appears at position 40. If you then search for 40, it appears at position 70. Search for 70, ... and so on. The sequence Dan found is: 40, 70, 96, 180, 3664, 24717, 15492, 84198, 65489, 3725, 16974, 41702, 3788, 5757, 1958, 14609, 62892, 44745, 9385, 169, 40...

One has to wonder: What is the probability of finding a loop for any given initial search string? Or even, within the infinite expansion of pi, would all searches necessarily fall into a loop? The expected number of digits required to find a search string is proportional to the length of the string, but the requirement to loop again makes the analysis a bit tricky. Anyone know?

Doug Hafen points out that that not all numbers will loop because of the self-locating strings. It's also possible to drop into a self-locating string, e.g., by searching for 211 -> 93 -> 14 -> 1. No loop. Thanks, Doug!

Information about query privacy.

On to More Information about Pi...