Provided in the zip file are:

     1.0  The source code.
     2.0  The executable file.
     2.0  Documentation.

Program Description and sample output:

I have written a simple program in Turbo Pascal to
generate all of the prime numbers less than or equal  
to a number that is input by the user.  This program 
differs from other programs intended to generate 
prime numbers in the following ways: 

     1.0  The sieve is placed as a random access file on a 
          ramdisk, hence the problem of the 64K limit for  
          an array for the sieve is eliminated -- no array! 

     2.0  The sieve, the resulting prime numbers, and the
          timing information are placed on separate files. 

     3.0  One does not need any special program to get
          around the 640k limitations.

This  is the output for the time required to find all of the 
prime numbers less than 20,000,000 on a Pentium running 
at 133 MHZ.  I have not provided the 1,270,606 primes.

Elapsed Time 
Hours         1
Minutes      35
Seconds      19
Number of Primes <=     20000000 is      1270606



Directions for program usage:

    1.0 Create a ramdisk of sufficient size to hold 
        the sieve file and the resulting output.  One byte
        is needed for each element in the sieve.  Foe example,
        20,000,000 is required for a sieve for N = 20,000,000.
        You may wish to use the logarithmic integral

          Li(x)  = 2 to x [dx / ln x]
     
        which can be approximated with

          x(1!/ ln x + 2! /(ln x) ^ 2 + 3!/(ln X) ^ 3 .... (n - 1)!/(ln x) ^ n)

         where ln is log base e, to estimate file size for the output.

     2.0 Copy the executable onto the ramdisk.  

     3.0 Run the program from the ramdisk.

WARNING:

DO NOT RUN THIS PROGRAM WITH THE SIEVE ON YOUR
HARD DRIVE.  IT'S EFFECTIVENESS COMES FROM THE SIEVE
BEING ON THE RAMDRIVE.  FURTHER, THE AMOUNT OF I/O
INVOLVING THE SIEVE IS ENORMOUS  -- YOU WILL WEAR
YOUR HARD DRIVE OUT!

References:

"Elementary Number Theory," by David M. Burton, Allyn and Bacon,
1980.  Very readable.

"Recreations in the Theory of Numbers," by Albert H. Beiler, Dover,
1966.  My favorite.

"Prime Numbers and Computer Methods for Factorization," by Hans
Riesel, Birkhauser, 1985.  Quite up-to-date.

This program is freeware with no strings attached.  
This program may be freely distributed.

Author:

T. F. Higginbotham
Computer Science
Southeastern Louisiana University
Hammond, Louisiana 70402


higginbotham@selu.edu
