View Single Post
  #9  
Old 11-24-2007, 04:58 PM
Siegmund Siegmund is offline
Senior Member
 
Join Date: Feb 2005
Posts: 1,850
Default Re: Simple storage problem (math)

For sufficiently large numbers, it becomes more efficient to store the sizes of the gaps between them, that to store zeroes and ones for the possible candidates. You are not THAT far from reaching this bound -- in fact, I wouldn't be surprised if you already had. (That is, gumpzilla isn't THAT far off base with his suggestion - the numbers just aren't quite big enough to use it from the start. Maybe store bits as above up to 100 million, and storing gap sizes later, would be more compact.)

Or - putting it another way - except for the first few lines, that 440-million-bit file mentioned above consists almost entirely of bytes containing eight 0s, or seven 0s and a 1.

That means your easiest solution, rather than applying a third kind of encoding to the list... Applying even the simplest kind of file compression to your list would let you fit at least another billion into your 55MB.
Reply With Quote