NAME
factor
—
ise integers
SYNOPSIS
factor |
number… |
factor |
< numbers |
DESCRIPTION
Writes factors of all numbers (if none specified, read from standard input, delimited by whitespace) to the standard output stream in ascending order, one per line, in the form
number:
prime prime prime
No primes are written for numbers smaller than 2.
EXIT STATUS
1 if at least one number wasn't actually, or was out of range.
EXAMPLES
$
factor
1410 1981 1410: 2 3 5 47 1981: 7 283$
tr
-cd
'0-9 \t\n' <
/dev/urandom|
dd
bs=60 count=1 |
factor
11: 11 41615: 5 7 29 41 0: 81: 3 3 3 3 1: 552: 2 2 2 3 23 7: 7 4900: 2 2 5 5 7 7 195283: 11 41 433 440343080901: 3 3 29 53 31832797 7472183475: 3 5 5 99629113
HISTORY
factor
first appeared in
Version 7 AT&T UNIX as
factor(1):
factor
[ number ]
A direct C port appeared in 4.1BSD as factor(6). It had been rewritten in 4.3BSD-Reno to parse one number per line, as opposed to just separating them by whitespace, and handle multiple arguments.
BUGS
This implementation uses a simplistic wheel factorisation algorithm, which isn't going to win any awards soon.