factor(1)factor(1)NAMEfactor - To get the prime factors of a number
SYNOPSISfactor [integer]
DESCRIPTION
When factor is used without an argument, it waits for an integer. When
a positive integer less than or equal to 10**14 (10 ^ 14) is given, it
factors the integer. The factor command also prints the prime factors
of the integer and then waits for another integer. The command exits
if it encounters a zero or any non-numeric character.
If factor is invoked with an argument, it factors the integer and then
exits.
The maximum time taken to factor an integer is proportional to sqrt(n).
This is the time the factorcommand will take when n is a prime or the
square of a prime.
The factor command also supports exponential input (10e10, 10E10) .
EXAMPLES
The following example shows the use of the command factor with normal
range integers. $factor 1015 1015
5
7
29 The following example shows use of the command factor with
out-- of--range integers. $factor 58584595792797592 58584595792797592
Ouch! The following example shows use of the command factor with expo‐
nential input. $factor 10e10 100000000000
2
2
2
2
2
2
2
2
2
2
2
5
5
5
5
5
5
5
5
5
5
5 The following example shows use of the command factor with expo‐
nential input. $factor 10E10 100000000000
2
2
2
2
2
2
2
2
2
2
2
5
5
5
5
5
5
5
5
5
5
5
ERRORS
The command factor prints out the error message Ouch! for input that
is out--of-range or garbage input and quits when a non-integer input is
used.
factor(1)