Research V7 development
[unix-history] / usr / man / man1 / factor.1
CommitLineData
62c1033b
RM
1.TH FACTOR 1
2.SH NAME
3factor, primes \- factor a number, generate large primes
4.SH SYNOPSIS
5.B factor
6[ number ]
7.PP
8.B primes
9.SH DESCRIPTION
10When
11.I factor
12is invoked without an argument, it waits for a number to be typed in.
13If you type in a positive
14number less than 2\u\s756\s0\d (about
15.if n 7.2e16)
16.if t 7.2\(mu10\u\s716\s0\d\|)
17it will factor the number and print its prime factors; each one is printed
18the proper number of times.
19Then it waits for another number.
20It exits if it encounters a zero or any non-numeric character.
21.PP
22If
23.I factor
24is invoked with an argument, it factors the number
25as above and then exits.
26.PP
27Maximum time to factor is proportional to
28.if n sqrt(n)
29.if t \(sr\o'\fIn\fR\(rn'
30and occurs when
31.I n
32is prime
33or the square of a prime.
34It takes 1 minute to factor a prime
35near
3610\u\s714\s0\d
37on a PDP11.
38.PP
39When
40.I primes
41is invoked, it waits for a number to be typed in.
42If you type in a positive
43number less than 2\u\s756\s0\d
44it will print all primes greater than or
45equal to this number.
46.SH DIAGNOSTICS
47`Ouch.' for input out of range or for garbage input.