Okay, so I think I've finally come up with the perfect method of compression for this specific type of data, at least for a first pass. It is perfectly possible I think, that a second pass with some other type of compression algorithm can also be beneficial, but that's not really relevant at this point.
Firstly the uncompressed data will be split up into 256mb segments. These segments could be of a different size, but 256mb is convenient....
it should also be noted that those =-a statements could potentially, though not likely, cause trouble. =(-a) would probably better, or at the very least some spacing.
You are of course right. If all I wanted was a command line utility to test large primes, I could certainly live with the overhead of 256 mb, but of course I can't stop there. I have to see how far I can't take it, how efficient I can make the process, how much I can compress the data, and in the end how many primes I can actually store in a reasonable amount of space.
It's nothing but a challenge, like climbing mount Everest. There's...
If I were to store all primes as you suggest, it would amount to 203.280.221*4 bytes, or ~756 mb, or twice that if you opt for 64 bit variables. Already that's a 300% (or 600%) argument against your suggestion. Furthermore, although I cannot be sure as I know little of such things, I think that the possibility of compressing said data would be vastly reduced.
Also, the approach I'm using of generating the initial range of primes, I believe,...
Compressing data with lots of reoccurring streams of consecutive zero bits
Hi there.
First of, this is only for the fun of it, and I have no illusions that it will ever lead anywhere. I simply want to learn and have fun while doing it.
So, I've written a small program, which calculates all primes, using a regular home brewed sieve, within the range of 32 bits, the idea being that nothing more is needed to test values within the 64 bit range.
Leave a comment: