Reading 100 billion digits takes hours, even for a fast computer. Nobody wants to wait that long for their birthday, so we did all the reading before you arrived and wrote down the answers.
- line 1415926535 → position 1
- line 4159265358 → position 2
- line 1592653589 → position 3
- Six 9s in a row (999999) live on a line of the small table → position 762
Step 1: slide a window along π
Picture π chalked along an endless board. Put a frame around the first ten digits after the 3, write down what is inside, then slide the frame one digit to the right and do it again.
Every frame is a ten-digit number, and every one of the 10 billion possible ten-digit numbers has its own line in a giant table. The first time a number shows up in the frame, its line gets the position. After that, the line is never touched again: we only care where a number first appears.
Step 2: one line per number
The table has 10 billion lines of 5 bytes each, about 50 gigabytes. Line number n belongs to the ten-digit number n, so the answer for 0123456789 lives at byte 123,456,789 × 5. No searching, no scanning: one read, and the position is right there. A line nobody filled means the number is not in the first 100 billion digits.
Numbers of 1 to 6 digits get a smaller table of their own. Numbers of 7 to 9 digits read a short run of neighbouring lines of the big table (every ten-digit number that starts with them) and take the earliest.
Step 3: check the work
Before the tables go anywhere, a separate checker that shares no code with the builder picks thousands of lines at random, reads the digits at each position and makes sure the number really starts there. It also checks that the count of empty lines is what chance predicts.
How deep do numbers hide?
Short numbers turn up almost at once; every extra digit sends them about ten times deeper. Where a typical number first appears:
- A 4-digit PIN: around 7,000 digits in.
- A birthday written DDMMYY: around 700,000 digits in.
- A birthday written DDMMYYYY: around 70 million digits in.
- A phone number without its leading 0: around 7 billion digits in.
What happens to what you type
Your number travels inside the request, never in the address bar, and we don't log it or keep it. The digits around your result are fetched by our server, so your browser never asks another site about your spot in π. More in the privacy notice.