Prime number module

Juha Autero Juha.Autero at iki.fi
Wed Oct 1 01:14:39 EDT 2003


Lulu of the Lotus-Eaters <mertz at gnosis.cx> writes:

> I was disappointed that gzip only reduces the size by 41%.  I would have
> guessed better, given the predominance of 0 bits. 

I think it is not a surprise. (But maybe that's because I tried it
before.) You need redundancy to compress data.  If bitmap of prime
numbers contained lot of redundancy, you could use it to generate
prime numbers. Of course bitmap is not the most efficient way to store
list of prime numbers, but neither is gzip the most efficient way to
find redundancy in it. IIRC gzip basically encodes repeating bit
patterns and it's hardly a suprise that bitmap of prime numbers
doesn't have lots of repeating bit patterns.

-- 
Juha Autero
http://www.iki.fi/jautero/
Eschew obscurity!






More information about the Python-list mailing list