factor(1) factor(1)
NAME
factor - resolve number into prime factors
SYNOPSIS
factor Format 1
factor number Format 2
DESCRIPTION
The factor command resolves a number into its prime factors. factor
can be invoked with or without an argument.
- Without an argument (Format 1):
You can enter numbers to be factored interactively. factor then
factors the number you enter and outputs its prime factors.
- With an argument (Format 2):
factor resolves the argument into its prime factors and outputs
them.
Format 1: Interactive factoring
factor
You enter numbers interactively. factor then resolves each number into
its prime factors and outputs each prime factor as many times as it is
contained in the number.
If you enter 0 or a non-numeric character, factor terminates.
Format 2: Factoring command-line arguments
factor number
number
number must be a positive decimal integer <= 10^14. factor
resolves the number argument into its prime factors and displays
the number followed by each prime factor the appropriate number
of times. number may also be specified in scientific notation,
e.g. 1420 as 1.42e3 or as 1.42E3. If you enter 0 or a non-numeric
character as number, the output is 0.
ERROR MESSAGES
Ouch!
The interactively entered number or the command-line argument is not
in the permissible range for factor. You may only specify positive
numbers that are less than or equal to 10^14.
Page 1 Reliant UNIX 5.44 Printed 11/98
factor(1) factor(1)
Not an integer!
The interactively entered number or command-line argument is not an
integer.
EXAMPLES
Example 1
Interactive factoring:
$ factor
123
3
41
777777777777777
Ouch!
1234
2
617
0
$
Example 2
Non-interactive factoring:
$ factor 100
100
2
2
5
5
Page 2 Reliant UNIX 5.44 Printed 11/98