Primes
Previous entry | Jan, 22nd, 2009: Primes | Next entry

Should you feel like it you can now calculate your own prime numbers with this Program (primesN2_02.exe) by yours truly.
I should probably add though that I can take no responsibility for whatever harm it might do. It runs fine on my computer, but it gets laggy when you type in numbers above 200 million (depending on how much RAM you have; I have 2gb. If you have less than this you will probably experience lagg with smaller numbers than that.)

So far I have been able to calculate all the 46009215 primes below 900 million in 271037 ms. I have nothing to compare this with though (do you?).
I have however compared to the "primes" function in MATLAB. I found all primes below 10 million in 400 ms. (best case), whereas the MATLAB function took closer to 550 ms. I haven't made any good and reliable tests with this though. (In fact none of the numbers here are very reliable they're just a few of the results I have found.)
I do have to admit that I am reasonably pleased with the algorithm being in the vicinity of MATLAB though, as the last time I tried something like this I came nowhere close. (I won't even tell you how bad it was.)

To use the program, simply download the executable and run it. Type in a number to get all the primes less than or equal to the number you have entered. Before the calculation is started you are asked whether you want the results to be stored to an external file. Type 1 if you want this, or 0 if you don't. Confirm all inputs with Enter.
I would love to hear from you if you have any experience with this sort of thing, as I have none what so ever.
Please let me know!

I once again underline that, although I have no reason to believe that the program will cause any harm, you can't come running to me if something does in fact happen.

Comments (2)

gravatar
anders wrote on Jan, 22nd, 2009 at 00:54:09
Gah... For some reason my upload script didn't work properly now, so I had to do some editing afterwards. I'm certain there are some spelling mistakes and so forth. Sorry about that, but I'm now going to sleep.
gravatar
anders wrote on Jan, 22nd, 2009 at 01:17:16
Oh, and if you can be bothered to run the program I would love it if you post your result here. The reported time and the number you entered :D

Now I shall go to sleep.
name
e-mail
www