Somewhat-optimized program to find every possible Social Security Number in the digits of pi
Can crunch through 100 billion digits of pi in under 40 seconds
See the blog post at vitez.me/ssns-in-pi
Usage
You'll need a .txt file with the decimal digits of pi. Up to a billion digits can be downloaded from calculat.io
Up to 100 trillion digits can be downloaded from this Google website. They're in .ycd format, so you'll need to use y-cruncher on a Windows or Linux machine to convert to the .txt decimal digits.
There's a tiny 1000-digit file included in this repo so the program is runnable as-is, but it only finds 878 SSNs.
Run the program with:
cargo run --release
Sample output
Results of a sample run with 100 billion digits
[ 0.00s] Generating the set of all valid SSNs
[ 0.13s] Done generating the set of all 888_931_098 valid SSNs
[ 0.13s] Memory-mapping pi digits file
[ 0.13s] Finding SSN matches in file with 100_000_000_000 digits
[ 36.89s] Done searching for matches
[ 36.89s] Total SSNs = 888_931_098, found = 888_931_098, missing = 0
[ 36.90s] Done