Results 1 to 40 of 74

Thread: Prime Numbers

Threaded View

  1. #28
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    Re: Prime Numbers

    I wonder. Could you store these as 4-byte long integers that could reach 2,147,483,648 in size? You pick up 1 byte for every prime larger than 9,999, 2 bytes for every prime larger than 99,999, etc. Not sure if that helps any, but the compression improves as the primes get bigger and there are more of them at the top than at the bottom. The first 200 million primes would thus require 800 Mb.

    How large is the 200 millionth prime number?

    After you get above 2^31, you could then go to a file using 8-byte currency to store numbers up to 16-digit accuracy to the left.
    Last edited by Code Doc; Sep 8th, 2009 at 09:00 AM.
    Doctor Ed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width