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