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

factor(1)						      General Commands Manual							 factor(1)

NAME
factor, primes - factor a number, generate large primes SYNOPSIS
[number] [start[stop]] DESCRIPTION
If no arguments are provided on the command line, waits for a number to be typed in. If a positive number is typed, it factors the number and print its prime factors; each one is printed the proper number of times. It then waits for another number. exits if it encounters a zero or any non-numeric character. If an argument is provided on the command line, factors the number as above, then exits. Maximum time to factor is proportional to sqrt(n) and occurs when n is prime or the square of a prime. The largest number that can be dealt with by is 1.0e14. prints prime numbers between a lower and upper bound. If no arguments are provided on the command line, waits for two numbers to be typed in. The first number is interpreted as the lower bound; the second as the upper bound. All prime numbers in the resulting inclusive range are printed. If start is specified, all primes greater than or equal to start are printed. If both start and stop are given, all primes occurring in the inclusive range start through stop are printed. start and stop values must be integers represented as long integers. If the stop value is omitted in either case, runs either until overflow occurs or until it is stopped by typing the interrupt character. The largest number that can be dealt with by is 2,147,483,647. DIAGNOSTICS
Both commands print when the input is out of range, illegal characters are encountered, or when start is greater than stop. EXAMPLES
Print the prime factorization for the number 12: Print all prime numbers between 0 and 20: factor(1)
Man Page