Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

UraniumRod

List of Primes

This topic is 6928 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Goto www.mathworld.com and search for List of Primes.

And then, do the freedom dance as you eat snickers!
OldManDave.

Edited by - OldManDave on 4/29/00 2:27:54 PM

Share this post


Link to post
Share on other sites
I''m only interested in a large list of primes if the list has all of ''em. The lists I''ve seen start out well, but give up before the last one.

Is it really that hard to make a list of all of ''em?!

Share this post


Link to post
Share on other sites
Well, duh uh! The prime numbers are hard to find as you go deeper into the number list. I don''t know if the prime numbers ever disappear. Here''s a hint: 2 is the ONLY prime and even number. So, that should cut off the rest of the primes into just odds. And, 1 is not considered a prime number... just in case you didn''t know.

I think there''s some wacky Calculus function that can find all primes given a range. You''d have to check on that at www.mathworld.com, I''m not sure.

OldManDave.

Share this post


Link to post
Share on other sites
I don't know how accurate this is.. but my old programming teacher said the equation (6n (+-) 1) would find most of the primes (that's 6n+1 and 6n-1). One of our programming assignments was to find the first prime number that equation wouldn't find. In order to make it faster, I used this method that involved arrays (seive of arisophany (spelling?)) to test numbers for primeness. And I ran out of stack space (because of the array size) before I found a prime that that equation wouldn't find (I don't *think* there were any errors in the program logic) (and I'm taking Turbo Pascal 7 for DOS, so the stack was limited size).

So 6n(+-)1 should find all the prime numbers for a HUGE range.

By the way, if I'm wrong, please tell me, because I never was satisfied with that program



------------------------------
Jonathan Little
invader@hushmail.com
http://www.crosswinds.net/~uselessknowledge

Edited by - Qoy on 4/29/00 3:39:59 PM

Share this post


Link to post
Share on other sites
Well johnhattan I do believe your joking baised on your post icon . But the list is pritty long right now it has all of the primes up to around 4,000,000 (and growing by about 5-10/s on my 166 upstairs) which isnt really far but the way I find the primes is very inefficient.

Qoy - That method seems to not work in all cases 6(9)+1 = 55. Would it skip some primes? And how HUGE is HUGE?

And if any one knows of a better way to find primes rather than doing a modulus (spelling its the '%' C++ operator) on n by all the numbers between 3 and n/2 and if one of the results is zero than its not prime otherwise it is. I already skip all even numbers.

UraniumRod

Edited by - UraniumRod on 4/29/00 4:54:22 PM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!