Looking for files of prime numbers
flag
Messages 1 - 10 of 145 - Collapse all
/groups/adfetch?adid=ziQnvhEAAADNDjSZZZIe2UsWDU5WJZfJFSRgCP-avRN4YT0eROC0jw
Looking for files of prime numbers  
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
1.  Gottfried Barthel  
View profile  
 More options Aug 1 2001, 6:11 am
Newsgroups: sci.math, sci.math.symbolic, comp.soft-sys.math.maple
From: Gottfried Barthel <Gottfried.Bart...@fmi.uni-konstanz.de>
Date: Wed, 01 Aug 2001 12:11:36 +0200
Local: Wed, Aug 1 2001 6:11 am
Subject: Looking for files of prime numbers
Dear Newgroup readers,

can anyone of you point out to me where to find lists of consecutive
primes say up to the range of the 50000th prime on the web? Reason: For
experimentally checking which prime numbers have some specific property,
I am running Maple's built-in "ithprime" function for increasingly
larger values of the counter. Maple's "ithprime" reads the first N
primes off from a list (where N is slightly larger than 30000), but as
soon as one wants to exceed these bounds, things get really very much
slowed down: Whereas the kind of test I want to do takes some 50 seconds
for the 500 primes in the range 24500 .. 25000, it takes some 10 minutes
for the 125 primes in the range 37000 .. 37125, most of which is
certainly used for finding these primes.

Any help would be appreciated.

Regards from Konstanz,

Gottfried Barthel

Fachbereich Mathematik und Statistik, Universitaet Konstanz

--
Mit freundlichen Gruessen

Gottfried Barthel

----------------------------------------------------------------------
  ___      
 /   \     Gottfried Barthel      | Tel:  [++49/0] 7531 88 27 93
|   _____  Fachbereich Mathematik | Fax:  [++49/0] 7531 88 30 36
|    |   \         und Statistik  | e-mail:                            
 \___|___/ Universitaet Konstanz  | Gottfried.Bart...@uni-konstanz.de
     |   \ Fach D 203             | WWW:      
    _|___/ D-78457 Konstanz       | www.mathe.uni-konstanz.de/
                                  |         ~barthel/
----------------------------------------------------------------------

(Fixed-width font, line lenght at least 72 characters)


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
2.  fredm  
View profile  
 More options Aug 1 2001, 6:30 am
Newsgroups: sci.math, sci.math.symbolic, comp.soft-sys.math.maple
From: "fredm" <nospam_fred...@hotmail.com>
Date: Wed, 1 Aug 2001 06:30:06 -0400
Local: Wed, Aug 1 2001 6:30 am
Subject: Re: Looking for files of prime numbers
Try http://www.utm.edu/research/primes/index.html

"Gottfried Barthel" <Gottfried.Bart...@fmi.uni-konstanz.de> wrote in message

news:3B67D5D8.6E94B918@fmi.uni-konstanz.de...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
3.  Nico Benschop  
View profile  
 More options Aug 1 2001, 7:27 am
Newsgroups: sci.math, sci.math.symbolic, comp.soft-sys.math.maple
From: Nico Benschop <n.bensc...@chello.nl>
Date: Wed, 01 Aug 2001 13:27:31 +0200
Local: Wed, Aug 1 2001 7:27 am
Subject: Re: Looking for files of prime numbers

Gottfried Barthel wrote:

> Dear Newgroup readers,
> can anyone of you point out to me where to find lists of consecutive
> primes say up to the range of the 50000th prime on the web? [...]
> -- Gottfried Barthel

Try "The Prime pages"  of prof. Chris Caldwell,
  for just about _anything_  regarding primes:
      http://www.utm.edu/~caldwell/              -- NB

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
4.  Richard B. Kreckel  
View profile  
 More options Aug 1 2001, 7:51 am
Newsgroups: sci.math, sci.math.symbolic, comp.soft-sys.math.maple
From: "Richard B. Kreckel" <Richard.Krec...@Uni-Mainz.DE>
Date: 1 Aug 2001 11:51:28 GMT
Local: Wed, Aug 1 2001 7:51 am
Subject: Re: Looking for files of prime numbers
In sci.math.symbolic Gottfried Barthel <Gottfried.Bart...@fmi.uni-konstanz.de> wrote:
: can anyone of you point out to me where to find lists of consecutive
: primes say up to the range of the 50000th prime on the web? Reason: For
: experimentally checking which prime numbers have some specific property,
: I am running Maple's built-in "ithprime" function for increasingly
: larger values of the counter. Maple's "ithprime" reads the first N
: primes off from a list (where N is slightly larger than 30000), but as
: soon as one wants to exceed these bounds, things get really very much
: slowed down: Whereas the kind of test I want to do takes some 50 seconds
: for the 500 primes in the range 24500 .. 25000, it takes some 10 minutes
: for the 125 primes in the range 37000 .. 37125, most of which is
: certainly used for finding these primes.
:
: Any help would be appreciated.

Why not hack a sieve in a few lines of C-code?

: Regards from Konstanz,

Regards from downstream
                     -richy.
--
Richard B. Kreckel
<Richard.Krec...@GiNaC.DE>
<http://www.ginac.de/~kreckel/>


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
5.  Gottfried Barthel  
View profile  
 More options Aug 1 2001, 12:06 pm
Newsgroups: sci.math, sci.math.symbolic, comp.soft-sys.math.maple
From: Gottfried Barthel <Gottfried.Bart...@fmi.uni-konstanz.de>
Date: Wed, 01 Aug 2001 18:06:37 +0200
Local: Wed, Aug 1 2001 12:06 pm
Subject: Re: Looking for files of prime numbers
Thanks to all of you for your answers. The "Prime number pages" are just
great!

A surprisingly simple and efficient Maple solution has been communicated
to me directly by David G Radcliffe:

   primes := array(1..50000):
   p := 1:
   for i from 1 to 50000 do
     p := nextprime(p):
     primes[i] := p
   od:

This works really well; on the SUN Ultra 10 (300 MHz) in my office, it
takes less than two minutes. The next 50000 primes take significantly
more time -- about 8 1/2 minutes --, but this is still quite reasonable.
This shows that Maple's "nextprime" is much more efficient than
"ithprime" in finding prime numbers, which comes as kind of surprise.

Regards from Konstanz,

Gottfried Barthel

Fachbereich Mathematik und Statistik, Universitaet Konstanz


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Speeding up the code (Re: Looking for files of prime numbers)  
6.  Gottfried Barthel  
View profile  
 More options Aug 1 2001, 1:09 pm
Newsgroups: sci.math, sci.math.symbolic, comp.soft-sys.math.maple
From: Gottfried Barthel <Gottfried.Bart...@fmi.uni-konstanz.de>
Date: Wed, 01 Aug 2001 19:09:08 +0200
Local: Wed, Aug 1 2001 1:09 pm
Subject: Speeding up the code (Re: Looking for files of prime numbers)
Hello all,

this is a brief addendum to the previous message:

I just checked that at the beginning, a simple additional "if"-switch in
the code allows to speed up things considerably by using Maple's
built-in "ithprime" up to i=30000, say, instead of "nextprime":

   primes := array(1..50000):
   for i from 1 to 50000 do  
   if p <= 30000 then
     p := ithprime(i)
   else
     p := nextprime(p):
   fi;
   primes[i] := p
   od:

It thus took Maple 8 sec. instead of 53 sec. on my own Mac G3 PowerBook
with a 233 Hz CPU to go through the range up to 30000, since the values
are just read off the table. If the range does not exceed 50000 too
much, this may be worth while; for a significantly larger range,
however, these 45 sec. do not matter too much any more ...

Regards from Konstanz,

Gottfried Barthel

Fachbereich Mathematik und Statistik, Universitaet Konstanz


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Looking for files of prime numbers  
7.  Robert Israel  
View profile  
 More options Aug 1 2001, 5:11 pm
Newsgroups: sci.math, sci.math.symbolic, comp.soft-sys.math.maple
From: isr...@math.ubc.ca (Robert Israel)
Date: 1 Aug 2001 20:53:42 GMT
Local: Wed, Aug 1 2001 4:53 pm
Subject: Re: Looking for files of prime numbers
In article <3B68290D.F6636...@fmi.uni-konstanz.de>,
Gottfried Barthel  <Gottfried.Bart...@uni-konstanz.de> wrote:

>A surprisingly simple and efficient Maple solution has been communicated
>to me directly by David G Radcliffe:
>   primes := array(1..50000):
>   p := 1:
>   for i from 1 to 50000 do
>     p := nextprime(p):
>     primes[i] := p
>   od:
>This works really well; on the SUN Ultra 10 (300 MHz) in my office, it
>takes less than two minutes. The next 50000 primes take significantly
>more time -- about 8 1/2 minutes --, but this is still quite reasonable.
>This shows that Maple's "nextprime" is much more efficient than
>"ithprime" in finding prime numbers, which comes as kind of surprise.

I don't know how you come to that conclusion.
On my computer (Pentium II/266, Windows 95) in Maple 7, Radcliffe's
program took 62 seconds, but the following took less than 41 seconds:

primes:= array(1..50000);
for i from 1 to 50000 do
  primes[i] := ithprime(i)
od:

Both ithprime(i) (if i < 100000) and nextprime(p) use very similar
strategies: they search for primes among odd numbers, starting at
p+1 or p+2 in the case of nextprime or at ithprime(i-1)+2 in the
case of ithprime.  The one difference is that ithprime checks
that the gcd of the candidate and 3929160775540133527939545
(which is the product of primes from 3 to 67) is 1 before calling
isprime, while nextprime calls isprime directly.  If ithprime(i-1)
is known (as it is in this loop), ithprime is very efficient.
Of course if you call ithprime(i) when ithprime(i-1) is not known,
it is much less efficient (and this shouldn't be a surprise), as
it has to go back to the largest j < i for which it knows
ithprime(j) and search from there.  It doesn't go all the way
back to 1, because it starts out with a remember table storing 292
values of ithprime.  But still, if you want say ithprime(49998)
it has to go check all the odd numbers from ithprime(49399)+2 =
603919 to ithprime(49998) = 611939.

Robert Israel                                isr...@math.ubc.ca
Department of Mathematics        http://www.math.ubc.ca/~israel
University of British Columbia            
Vancouver, BC, Canada V6T 1Z2


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
8.  flip  
View profile  
 More options Aug 1 2001, 5:48 pm
Newsgroups: sci.math, sci.math.symbolic, comp.soft-sys.math.maple
From: F...@safebunch.com
Date: Wed, 01 Aug 2001 21:48:03 GMT
Local: Wed, Aug 1 2001 5:48 pm
Subject: Re: Looking for files of prime numbers
Using Mathematica, the entire code is :

Table[Prime[i],{i,1,50000}]

It took 1.6 seconds on a PIII 600 MHz Windows NT 4.0 machine for 50000.

Doing the first 100000 took a whole 3.5 seconds.

I'll email you the list if you'd like.

Wilson

In article <9k9q8m$28...@nntp.itservices.ubc.ca>, Robert Israel says...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
9.  The Scarlet Manuka  
View profile  
 More options Aug 1 2001, 11:30 pm
Newsgroups: sci.math, sci.math.symbolic, comp.soft-sys.math.maple
From: "The Scarlet Manuka" <sa...@maths.uwa.edu.au>
Date: Thu, 2 Aug 2001 11:25:12 +0800
Local: Wed, Aug 1 2001 11:25 pm
Subject: Re: Looking for files of prime numbers
"Gottfried Barthel" <Gottfried.Bart...@fmi.uni-konstanz.de> wrote in
message news:3B68290D.F66369F1@fmi.uni-konstanz.de...

> This works really well; on the SUN Ultra 10 (300 MHz) in my office, it
> takes less than two minutes. The next 50000 primes take significantly
> more time -- about 8 1/2 minutes --, but this is still quite reasonable.
> This shows that Maple's "nextprime" is much more efficient than
> "ithprime" in finding prime numbers, which comes as kind of surprise.

I don't see why; once you get significantly past the list, each call
to ithprime has to determine all the previous primes past the list too.
Using nextprime means you only need to determine one more prime on each
call. So the results you report are what I would expect.

--
The Scarlet Manuka


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
10.  E. Clark  
View profile  
 More options Aug 2 2001, 10:54 am
Newsgroups: sci.math, sci.math.symbolic, comp.soft-sys.math.maple
From: ecl...@math.usf.edu (E. Clark)
Date: 2 Aug 2001 07:54:42 -0700
Local: Thurs, Aug 2 2001 10:54 am
Subject: Re: Looking for files of prime numbers
"The Scarlet Manuka" <sa...@maths.uwa.edu.au> wrote in

> I don't see why; once you get significantly past the list, each call
> to ithprime has to determine all the previous primes past the list too.
> Using nextprime means you only need to determine one more prime on each
> call. So the results you report are what I would expect.

Actually, after the 25th prime in Maple 6, ithprime invokes the
recursive procedure `ithprime/small` which creates a remember table.
So it doesn't have to determine all previous primes.  Maple 6 to begin
with has builtin a rather large table of values the largest of which
is

      ithprime(22299999) = 36447497,

op(4,evalf(`ithprime/large`));   will give the full table.  So even at
the beginning it doesn't have to go all the way back to the beginning
to find the next prime.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google