3 ms·
If my math is to be believed, 5096876/90000000 or ~0.056632; roughly 1 in 20. Edit: Here's my program: http://pastebin.com/sBsXjPt5 http://pastebin.com/sBsXjPt
by benjamincburns 13y ago
If my math is to be believed, 5096876/90000000 or ~0.056632; roughly 1 in 20.
Edit:
Here's my program: http://pastebin.com/sBsXjPt5 http://pastebin.com/sBsXjPt5
Usage:
gcc primes.c -O2 -o primes; ./primes 8 | wc -l
Edit 2: Nevermind; I'm dumb. First, there are 10^8 unique 8 digit combos, not 10^8-10^7. If all combinations were legal we'd have a probability of 0.05096876. But I assume all combinations are not legal, so that answer too is wrong. Maybe later if I'm bored and have more time I'll research the Danish telephone system and get an accurate number.
- benjamincburns 13y agoAlright - Denmark made it easy on me with the spreadsheet here: http://www.erhvervsstyrelsen.dk/numbering_lists http://www.erhvervsstyrelsen.dk/numbering_lists The probability that a valid, non-reserved, 8-digit danish phone number is prime is 4208056/73399100, or ~0.0573312. This probability does not account for number blocks which are valid but not yet assigned/purchased. Code uses a copy of the number spreadsheet without header row saved as 'danish_numberlist.csv' Code here: http://pastebin.com/kWUsHsL4 http://pastebin.com/kWUsHsL4