NAME

sieve — Compute successive prime numbers.

synopsis

wyrm::sieve [ number-of-primes ] [ -tmp folder ] [ -o channel ]

description

This computes prime numbers with a modified form of the Sieve of Eratosthenes: rather than a bit array of numbers and then skipping through every nth entry, it keeps a list of prime numbers up to the rth entry of the sieve and and how far r is from the last multiple of each seen prime.

The arithmetic requires just increment and decrement; it is computed on ASCII strings in decimal radix, limitted by the maximum string size rather than machine integer sizes. Also the sieve arrays are stored as files; the maximum number of primes is then determined by the file system capacity rather than memory size.

number-of-primes
Stop after computing this many primes and return the last one. If the temporary files are deleted, successive calls for larger number of primes restart from the previous computation.
-tmp folder
Store the temporary files in this folder. Default is the current folder. There are one or two files, A.sve and B.sve.
-o channel
Output primes, one per line, to this channel. Default is stdout. If channel is "none" the output is suppressed.