The PRIME NUMBERS - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QbasicNews.Com (http://qbasicnews.com/newforum/forum-3.html) +--- Forum: Challenges (http://qbasicnews.com/newforum/forum-10.html) +--- Thread: The PRIME NUMBERS (/thread-779.html) |
The PRIME NUMBERS - ak00ma - 06-04-2003 The MATRIX gonna get you 8) The PRIME NUMBERS - Touf - 06-04-2003 Antoni , is this the program you mailed me ? If not , mail me your last version please ! The PRIME NUMBERS - Antoni Gual - 06-04-2003 Touf: Check your e-mail The PRIME NUMBERS - Agamemnus - 06-04-2003 there is stuff missing in other sections, too!!!! EDIT: Projects section. The PRIME NUMBERS - whitetiger0990 - 06-04-2003 where? The PRIME NUMBERS - Neo - 06-04-2003 Quote:I left my computer on running your program last night dav... It went up and over 14,000,000 primes somehow. Whow! 14,000,000! Not bad Mine got till the LONG overflow, that is up to and including 7FFFh And just in 1,5 hour The PRIME NUMBERS - Mango - 06-04-2003 Quote:Mine got till the LONG overflow, that is up to and including 7FFFh That's pretty good. What's your method? I just compiled a slightly modified version (doesn't poll the timer, instead prints a prime every 64 k found) of mine and it's running in a background window on a 1.5 GHz machine...it's been on for a whopping 7 min 20 sec and the most recent prime is 19,562,177...at this rate, mine's not set to overflow the long integer until about 13 hrs. I'd like to see your method...it kicks my methods ass. Is it a method that picks primes with high probability, or does it exhastively prove each prime? Anyway...we're up to 11 min, 30 sec and latest prime is.... 27,033,163... edits: 36 min...60,193,877 3 h 41 min...240,677,251 The PRIME NUMBERS - Antoni Gual - 06-05-2003 Mango: First of all your method is faster than your results. You should leave the computer runing your compiled program alone in the foreground. This way you should reach the long overflow before 4 hours. And the 1,5 hour could be reached by the program by Rich Geldreich you posted when this challenge started (you said clearly you did'nt write it). I have no patience to check it but it could reach the limits in 1,5 hour as Neo says. Remember i'ts a program ported from the computer bible "The Art of Computer Programming" so it should be good. By the way , could someone explain me how does it work? Edited: About speed, don't forget there are AMD processors abe to run 16 bits apps 3 times faster than a P4 1,5...Any speed comparison should be done in the same computer! The PRIME NUMBERS - Agamemnus - 06-05-2003 It checks every odd number for primality by seeing if it is evenly divisible by every number that is less than 32767. The reason is that it is slower to do mod using integers, but you can only check up to 32761 (I think it's a prime) squared. A number can be checked for primality by just doing mod all primes less than the square root of that number because you just check the same numbers over again after... (x+1)(x-1) (x-1)(x+1) The PRIME NUMBERS - Neo - 06-05-2003 Quote:Neo Wrote:Mine got till the LONG overflow, that is up to and including 7FFFh It wasn't made in QB . However, these are the test results with my program made in QB: 1 min: 2,000,000 2 min: 4,031,482 1 h: 240,482,843 The programming algorithm was the Sea of Erathetos. However, there are much faster algorithms |