·  Home
+   man pages
 -> Linux -> FreeBSD -> OpenBSD -> NetBSD -> Tru64 Unix -> HP-UX 11i -> IRIX
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

man pages->HP-UX 11i man pages -> primes (1)
 Title
 Content
 Arch
 Section All Sections 1 - General Commands 2 - System Calls 3 - Subroutines 4 - Special Files 5 - File Formats 6 - Games 7 - Macros and Conventions 8 - Maintenance Commands 9 - Kernel Interface n - New Commands

### Contents

```
factor(1)                                                         factor(1)

NAME    [Toc]    [Back]
factor, primes - factor a number, generate large primes

SYNOPSIS    [Toc]    [Back]
factor [number]

primes [start[stop]]

DESCRIPTION    [Toc]    [Back]
If no arguments are provided on the command line, factor 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.  factor exits if
it encounters a zero or any non-numeric character.

If an argument is provided on the command line, factor 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 factor is 1.0e14.

primes prints prime numbers between a lower and upper bound.  If no
arguments are provided on the command line, primes 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, primes runs either until
overflow occurs or until it is stopped by typing the interrupt
character.

The largest number that can be dealt with by primes is  2,147,483,647.

DIAGNOSTICS    [Toc]    [Back]
Both commands print Ouch when the input is out of range, illegal
characters are encountered, or when start is greater than stop.

EXAMPLES    [Toc]    [Back]
Print the prime factorization for the number 12:

factor 12

Hewlett-Packard Company            - 1 -   HP-UX 11i Version 2: August 2003

factor(1)                                                         factor(1)

Print all prime numbers between 0 and 20:

primes 0 20

Hewlett-Packard Company            - 2 -   HP-UX 11i Version 2: August 2003```
[ Back ]
Similar pages
 Name OS Title factor NetBSD factor a number, generate primes primes NetBSD factor a number, generate primes primes OpenBSD factor a number, generate primes factor OpenBSD factor a number, generate primes BN_generate_prime Tru64 Generate primes and test for primality BN_is_prime_fasttest OpenBSD generate primes and test for primality BN_generate_prime NetBSD generate primes and test for primality BN_is_prime OpenBSD generate primes and test for primality BN_is_prime Tru64 Generate primes and test for primality BN_generate_prime OpenBSD generate primes and test for primality