BTW, I seem to remember that GMP stores the table of small primes as a
vector of the differences between consecutive primes. Storing a byte
per prime goes a long way.

Let's see... there are 50847534 primes under 10^9, the max difference
between a consecutive pair of them is 282. We can store that value /2,
so the max number we need to store is 141, which fits in a byte.

So this table would need 48MB in this representation, and (/ (expt 10
9) 8) ==> 119M bytes as a bit-vector.

Just another possibility...

Cheers
P.
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to