[racket] Math library ready for testing

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Tue Dec 11 09:03:46 EST 2012

2012/12/11 Stephen Bloch <bloch at adelphi.edu>:

> Would it perhaps make more sense for small-primes to contain primes
> themselves, in increasing order so one can be found by binary search, rather
> than booleans?  The O(1) behavior would be replaced by O(log(limit)), but
> perhaps you would save enough memory to put the limit higher.

I think there are too many primes.

Since

    > (require math)
    > (nth-prime 78498)
    1000003

there are 78497 primes below a million. On a 64 bit machine
that requires  8*78497 = 627976 bytes.

-- 
Jens Axel Søgaard


Posted on the users mailing list.