Free to download and use.


  • Due to a number of requests I have spent a couple of hours putting together a Prime Number Generator, it should test about 40 thousand numbers per second on any 486 or above, however I have only used "longs" so the top limit is about 2^30 but that is still within ten digits.

Prime Generator II

As you can see below all prime numbers were Generated from
2 to 99,999,989 in 7 minutes 48 seconds.

 Or about 5 seconds to generate every prime up to 999,983 

This is 5 microsecond to test and save each and every prime number.

how fast is that then on a 486 system...

It took just under 7 hours to save every prime number from 2 to 999,999,937

1,000,000,000 'numbers' ÷ (7 hours = 25,000 seconds) equals 40,000 numbers tested per second.

Update You can see that every Mersenne prime found in this list of primes.

Download Prime Number Genrator  

That's not bad compression 7K to 600Meg

  • set the block size from 1 Meg to 100 Meg.

  • If you set the Block size to big for your system, then the virtual engine will kick in and will slow the generator down.

    • If your system has 128Mb set maximum block size 40Meg

    • If your system has 256Mb set maximum block size 100Meg

  • The generator will generator every prime number up to the point you stop it or it runs out of space. Err1101999999
  • The generator goes through three stages Setting up, Compressing, and Generating.
  • The generator test a block of 1-100 million numbers at anyone time.
  • Please note that the files can get very big and the final file will be 600Meg
  • Err1101999999 = Run out  of resources. you should have a prime number of 1,073,741,789
  • Because of the size of the Primes.txt file you may find it hard to open, so I have added a viewer as your poor littlie text edit will fail to work.

How to use the auto repeat.

  • When you check the auto repeat box the generator will continue to run until you uncheck it, please note if you close the program before letting the genarator stop you will corrupt the Primes.txt file.
  •  
    • Note unclick the auto repeat and let the generator stop "waiting" before closing program.
  •  
    • If you corrupt the Primes.txt file you can rename the Primes.bak file to Primes.txt to continue.
    • The formula I have used is.

      Pi+1 = next prime, P1 = first prime, P2 = second prime

       n = prime number, Pi+P2i = inverse sum of all primes to n

      The above formula has no missing or additional primes.

      Each prime generates a new prime number in the prime map.

Had time to put this viewer together it's not that fast but look at the file size, However you can copy and past from it.

    • You can use this viewer to find any prime number within the Primes.txt file you have generated. 

    You must generate a Primes.txt file before you can use the Viewer.

    You will need to put the viewer in the same folder as the Primes.txt file.

    • Use the find button to find the prime number or the next prime number nearest to your entry.

    • Use the next button to display the next set of prime numbers in the Primes.txt file.

    Running Visual Basic Programs on Windows 95 / 98 / Me may give an DLL missing error. You will need to download and install MSvbvm60.dll you only need to do this once to use all our programs.

    • We have put together a program and all the prime numbers from 2 to 999,999,937 on one CD so at a press of a button you can view any of the above prime numbers. The CD cost £5 this includes post and packaging for more information use our contact page.