[racket] Math library ready for testing

From: Pierpaolo Bernardi (olopierpa at gmail.com)
Date: Tue Dec 11 11:56:03 EST 2012

On Tue, Dec 11, 2012 at 5:11 PM, Stephen Bloch <sbloch at adelphi.edu> wrote:


> How many primes are below ten million?  A hundred million?  At some point storing the primes will take less memory than storing primality flags, but that point may be above the size of tables we can realistically store today.

> (for ((i (in-range 3 9)))
    (printf "~a: ~a~n" i (boolean-vector-count (boolean-sieve (expt 10 i)))))
3: 168
4: 1229
5: 9592
6: 78498
7: 664579
8: 5761455

(some values may be higher than the right number, as my boolean-sieve
function rounds up the limit to the next 8 multiple)

P.

Posted on the users mailing list.