Loading ...
Sorry, an error occurred while loading the content.

Re: [PrimeNumbers] need help

Expand Messages
  • Kermit Rose
    From: Burlacu Bogdan Date: 12/02/05 17:31:18 To: primenumbers@yahoogroups.com Subject: [PrimeNumbers] need help could someone please tell me where can i find a
    Message 1 of 7 , Dec 2, 2005
    • 0 Attachment
      From: Burlacu Bogdan
      Date: 12/02/05 17:31:18
      To: primenumbers@yahoogroups.com
      Subject: [PrimeNumbers] need help

      could someone please tell me where can i find a list of the first
      1 000 000 000 (1 billion) prime numbers. i need it for a program,
      but i cannot generate it myself because it would just take too much
      time
      thx



      Kermit says:

      Actually it takes very little time to calculate by the sieve method, a large
      number of
      primes.

      The main problem for you will be storing the primes.

      It would probably be best to re-calculate them each time and have some way to encode them into a shorter space.

      [Non-text portions of this message have been removed]
    • Alan Eliasen
      ... It would probably take you much longer to post a request and wait for a reply, or to download the list. I just used an intentionally-dumb method to list
      Message 2 of 7 , Dec 3, 2005
      • 0 Attachment
        Burlacu Bogdan wrote:
        > could someone please tell me where can i find a list of the first
        > 1 000 000 000 (1 billion) prime numbers. i need it for a program,
        > but i cannot generate it myself because it would just take too much
        > time

        It would probably take you much longer to post a request and wait for
        a reply, or to download the list. I just used an intentionally-dumb
        method to list those primes, and it took 31 minutes. The file is over
        500 megabytes, or 151 megabytes compressed with bzip2's "best" compression.

        I'm not going to send you the list, but here's the whole Frink program:

        for a = 2 to 1 billion
        if isPrime[a]
        println[a]

        It's left as an exercise to see how to speed this up. Frink can be
        obtained at http://futureboy.us/frinkdocs/

        --
        Alan Eliasen | "It's amazing how much mature wisdom
        eliasen@... | resembles being too tired."
        http://futureboy.homeip.net/ | -- Robert Heinlein
      Your message has been successfully submitted and would be delivered to recipients shortly.