Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

primes(6) [freebsd man page]

FACTOR(6)							 BSD Games Manual							 FACTOR(6)

NAME
factor, primes -- factor a number, generate primes SYNOPSIS
factor [-h] [number ...] primes [-h] [start [stop]] DESCRIPTION
The factor utility will factor positive integers. When a number is factored, it is printed, followed by a ':', and the list of factors on a single line. Factors are listed in ascending order, and are preceded by a space. If a factor divides a value more than once, it will be printed more than once. When factor is invoked with one or more arguments, each argument will be factored. When factor is invoked with no arguments, factor reads numbers, one per line, from standard input, until end of file or error. Leading white-space and empty lines are ignored. Numbers may be preceded by a single '+'. Numbers are terminated by a non-digit character (such as a newline). After a number is read, it is factored. The primes utility prints primes in ascending order, one per line, starting at or above start and continuing until, but not including stop. The start value must be at least 0 and not greater than stop. The stop value must not be greater than the maximum. The default and maximum value of stop is 3825123056546413050. When the primes utility is invoked with no arguments, start is read from standard input and stop is taken to be the maximum. The start value may be preceded by a single '+'. The start value is terminated by a non-digit character (such as a newline). DIAGNOSTICS
negative numbers aren't permitted illegal numeric format start value must be less than stop value Result too large BUGS
factor cannot handle the ``10 most wanted'' factor list, primes will not get you a world record. primes is unable to list primes between 3825123056546413050 and 18446744073709551615 since it relies on strong pseudoprime tests after siev- ing, and nobody has proven how many strong pseudoprime tests are required to prove primality for integers larger than 3825123056546413050. BSD
October 10, 2002 BSD

Check Out this Related Man Page

MATHO-PRIMES(1) 					       Mathomatic Utilities						   MATHO-PRIMES(1)

NAME
matho-primes - generate consecutive prime numbers SYNOPSIS
matho-primes [start [stop]] ["twin"] ["pal" [base]] matho-primes [-htu] [-c count] [-m number] [-p base] [start [stop]] DESCRIPTION
This command-line utility is optionally part of the mathomatic(1) package. It quickly computes any number of consecutive prime numbers using a windowing, memory efficient sieve of Eratosthenes algorithm, dumping them to standard output. They are displayed one prime per line in ascending order, unless the "twin" option is specified, which displays only twin primes, two primes per line. Generates up to 18 decimal digit primes, or whatever is the number of digits of precision for a floating point long double in the C com- piler used to compile this utility. Note that this utility might be compiled to use only double precision floating point, if long double precision is not fully supported by the C compiler or hardware, allowing at most 15 decimal digit primes in that case. Ways to verify that this utility is working are to pipe the output into the Unix "factor" utility, or compare the output with the BSD Games "primes" utility. All numbers displayed by this utility are decimal (base 10) prime numbers. A prime number is an integer that cannot be factored. A range may be specified on the command line, otherwise the starting number and the number of primes to output is prompted for. The range is start to stop inclusive, and stop must be greater than or equal to start. If the -c option is specified, the number of lines of primes displayed is limited to the decimal count that follows this option. If the -t or "twin" option is specified on the command line, only twin primes will be displayed. Twin primes are two primes that differ in value by 2. Each twin pair is displayed together on the same line separated by a space character. If the -p or "pal" option is specified on the command line, only palindromic primes are displayed. Palindromes are symmetrical, they read exactly the same forward and backward. The palindromic number base may be specified, the default is base 10. The base can be any integer greater than 1. Primes are always displayed in decimal (base 10). The version number and short help on the allowed command-line parameters and usage information are displayed when given the -h option. With the -u option, all output (standard output and standard error output) is set to be unbuffered, making all output happen immediately, instead of when the output buffer is full or when the program terminates or waits for input. The -m option changes the memory size of the prime number sieve window. It is followed by a decimal, floating point number which is a mul- tiplier of the default window size. It is possible that changing the memory size may speed up the total run time; otherwise there is no reason to use this option. AUTHOR
George Gesslein II (gesslein@mathomatic.org) at "http://www.mathomatic.org". REPORTING BUGS
If you find a bug, please report it to the author or at "https://launchpad.net/mathomatic". SEE ALSO
mathomatic(1), primorial(1), matho-mult(1), matho-sum(1) Mathomatic MATHO-PRIMES(1)
Man Page