At 09:35 PM 1/12/99 +0000, Daniel Grace wrote:
 > On the more relevant issue of storing Mersennes
>is this question and storing numbers from
>Mathematical series (particularly primes)
>in general is:
>Has anyone worked out an efficient way to
>compress the primes or prime exponents that
>produce prime Mersennes?


I doubt that the Mersenne exponents can be compressed much.  As far as a 
general prime list, there are several ways to save space.  One is to store 
the gaps between primes instead of the primes themselves, and reconstruct 
the primes as you read through the list.  One byte for the semi-difference 
suffices to fairly large primes.  Another way is to use a bit vector 
indicating whether the given number is prime or not.  Which method is best 
depends on the size of the list, and how you want to use the list.

+--------------------------------------------------------+
|                  Jud McCranie                          |
|                                                        |
| 137*2^197783+1 is prime!  (59,541 digits, 11/11/99)    |
+--------------------------------------------------------+

_________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ      -- http://www.tasam.com/~lrwiman/FAQ-mers

Reply via email to