BirthdayPi is a Windows-friendly tool that searches for a digit string inside the digits of π after the decimal point (π = 3.<digits>). It uses a responsive Tkinter GUI and can optionally reuse cached π digits stored in RAM (SharedMemory) or in a .bpi cache file.
You can use it in:
- Birthday Mode: enter
MM/DD/YYYYand search forMMDDYYYY - Number Mode: search for any numeric string you provide
-
birthdaypi.exe
Prebuilt Windows executable. Contains thebirthdaypi_cache_1000000000.bpifile and is automatically unpacked upon launch. VirusTotal hates this behavior, so feel free to build the exe yourself or just run from source (Python). -
birthdaypi_cache_1000000000.bpi
A.bpicache containing 1,000,000,000 digits of π (digits after the decimal). Download this if you're planning on running from source (Python >=3.8)
-
birthdaypi.py
Main GUI application. -
resource_unpack.py
Helper that copies bundled resources (like the 1B cache file) into the current directory on first run. Only needed when packing your own Windows executable. -
piconvert.py
Converter utility for creating.bpicache files from π text files. -
pi_max_precision.py
Reports MPFR maximum precision and estimates safe π digit limits for the MPFR approach. -
pi_race_benchmark.py/pi_crossover_headtohead.py
Benchmark scripts for performance comparisons. -
requirements.txt
Python dependency list (runtime).
- Navigate to the releases page and download
birthdaypi.exe. - Run:
dist/birthdaypi.exe
On first run, the EXE will unpack the 1B Pi digit file in the CWD:
birthdaypi_cache_1000000000.bpi
When presented with the GUI, click on load and select the newly unpacked birthdaypi_cache_1000000000.bpi file.
- Python 3.8+
Optional:
- Download
birthdaypi_cache_1000000000.bpifrom the releases page (1 billion digits of Pi)
Recommended:
-
- Create your Python virtual environment:
python -m venv venv
- Create your Python virtual environment:
-
- Enter your Python virtual environment:
.\venv\Scripts\activate
- Enter your Python virtual environment:
Install dependencies:
pip install -r requirements.txtRun the GUI:
python birthdaypi.py- Click Mode to toggle between:
- Birthday: enter MM / DD / YYYY
- Number: enter any numeric string
When a match is found, the app reports the index counted in digits AFTER the decimal point, starting at 1:
- π =
3.14159... - The digit
1immediately after the decimal is index 1
- Save writes your currently cached digits to a
.bpifile. - Load loads a
.bpifile into a GUI-owned SharedMemory cache.
.bpi file format
- 12-byte header:
b"BPI1"magic (4 bytes)- digit count (uint64, 8 bytes, little-endian)
- followed by exactly
digit_countbytes of ASCII digits (0–9)
The GUI can compute π digits using MPFR (gmpy2.const_pi()), but MPFR has a build-dependent maximum precision.
On many Windows builds, you may hit a practical limit around the low hundreds of millions of digits.. If you need more, use a .bpi cache file instead (like the included 1B cache).
Use:
python pi_max_precision.py…to see the max precision for your environment and estimate safe digit limits. This is only relevant to users that wish know the precision limit for calculating their own Pi numbers using BirthdayPi. The key takeaway is that BirthdayPi can only calculate to a certain extent. In my testing, it's ~323,227,792 digits, give or take a lil' overhead.
Use piconvert.py to convert large text files of π digits into the .bpi format for fast loading/searching.
python piconvert.py(Depending on your version of piconvert.py, it may open file pickers or accept CLI arguments.)
pi_race_benchmark.py: compare approaches and throughputpi_crossover_headtohead.py: crossover / head-to-head benchmark
Run:
python pi_race_benchmark.py
python pi_crossover_headtohead.pyIf you rebuild the EXE yourself, include the cache file as bundled data:
pyinstaller --noconsole --onefile birthdaypi.py --add-data "saves\birthdaypi_cache_1000000000.bpi;saves"resource_unpack.py handles copying it out to the current directory on first run.
MIT