Qbasicnews.com

Full Version: The PRIME NUMBERS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
The MATRIX gonna get you

8)
Antoni , is this the program you mailed me ?

If not , mail me your last version please !
Touf: Check your e-mail
there is stuff missing in other sections, too!!!!

EDIT: Projects section.
where?
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 Smile

Mine got till the LONG overflow, that is up to and including 7FFFh Wink
And just in 1,5 hour
Quote:Mine got till the LONG overflow, that is up to and including 7FFFh Wink
And just in 1,5 hour

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
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!
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)
Quote:
Neo Wrote:Mine got till the LONG overflow, that is up to and including 7FFFh Wink
And just in 1,5 hour

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

It wasn't made in QB Smile. 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 Smile
Pages: 1 2 3 4 5 6 7