This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jfine2358
Recipients jfine2358, mark.dickinson, serhiy.storchaka, steven.daprano, tim.peters, trrhodes
Date 2020-03-21.16:11:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
A pre-computed table of primes might be better. Of course, how long should the table be. There's an infinity of primes.

>>> 2**32

This number is approximately 4 * (10**9). According to, there are 50,847,534 primes less than 10**9. So, very roughly, there are 200,000,000 primes less than 2**32.

Thus, storing a list of all these prime numbers as 32 bit unsigned integers would occupy about
>>> 200_000_000 / (1024**3) * 4
or in other words 3/4 gigabytes on disk.

A binary search into this list, using as starting point the expected location provided by the prime number theorem, might very well require on average less than two block reads into the file that holds the prime number list on disk. And if someone needs to find primes of this size, they've probably got a spare gigabyte or two.

I'm naturally inclined to this approach because by mathematical research involves spending gigahertz days computing tables. I then use the tables to examine hypotheses. See This involves subsets of the vertices of the 5-dimensional cube. There are of course 2**32 such subsets.
Date User Action Args
2020-03-21 16:11:06jfine2358setrecipients: + jfine2358, tim.peters, mark.dickinson, steven.daprano, serhiy.storchaka, trrhodes
2020-03-21 16:11:06jfine2358setmessageid: <>
2020-03-21 16:11:06jfine2358linkissue40028 messages
2020-03-21 16:11:05jfine2358create