FACTOR(6) BSD Games Manual FACTOR(6)NAME
factor -- factor a number
SYNOPSIS
factor [number ...]
DESCRIPTION
The factor utility factors integers larger than 1. When a number is factored, it is printed, followed by a ``:'', and the list of (prime)
factors on a single line. Factors are listed in ascending order, and are preceded by a space. If a factor divides a value more than once,
it will be printed more than once.
When factor is invoked with one or more arguments, each argument will be factored.
When factor is invoked with no arguments, factor reads numbers, one per line, from standard input, until end of file or error. Leading
white-space and empty lines are ignored. Numbers may be preceded by a single +. Integer less than 2 are rejected. Numbers are terminated
by a non-digit character (such as a newline). After a number is read, it is factored. Input lines must not be longer than LINE_MAX - 1
(currently 2047) characters.
By default, factor is compiled against the OpenSSL bignum implementation openssl_bn(3), which lets it handle arbitrarily large values. (Note
however that very large values can take a very long time to factor.) If factor is compiled without OpenSSL it is limited to the maximum value
of unsigned long.
DIAGNOSTICS
Out of range or invalid input results in an appropriate error message being written to standard error.
BSD May 15, 2010 BSD
Check Out this Related Man Page
FACTOR(6) BSD Games Manual FACTOR(6)NAME
factor, primes -- factor a number, generate primes
SYNOPSIS
factor [-h] [number ...]
primes [-h] [start [stop]]
DESCRIPTION
The factor utility will factor positive integers. When a number is factored, it is printed, followed by a ':', and the list of factors on a
single line. Factors are listed in ascending order, and are preceded by a space. If a factor divides a value more than once, it will be
printed more than once.
When factor is invoked with one or more arguments, each argument will be factored.
When factor is invoked with no arguments, factor reads numbers, one per line, from standard input, until end of file or error. Leading
white-space and empty lines are ignored. Numbers may be preceded by a single '+'. Numbers are terminated by a non-digit character (such as
a newline). After a number is read, it is factored.
The primes utility prints primes in ascending order, one per line, starting at or above start and continuing until, but not including stop.
The start value must be at least 0 and not greater than stop. The stop value must not be greater than the maximum. The default and maximum
value of stop is 3825123056546413050.
When the primes utility is invoked with no arguments, start is read from standard input and stop is taken to be the maximum. The start value
may be preceded by a single '+'. The start value is terminated by a non-digit character (such as a newline).
DIAGNOSTICS
negative numbers aren't permitted
illegal numeric format
start value must be less than stop value
Result too large
BUGS
factor cannot handle the ``10 most wanted'' factor list, primes will not get you a world record.
primes is unable to list primes between 3825123056546413050 and 18446744073709551615 since it relies on strong pseudoprime tests after siev-
ing, and nobody has proven how many strong pseudoprime tests are required to prove primality for integers larger than 3825123056546413050.
BSD October 10, 2002 BSD
So all the research I've done shows that the reason I'm getting an error message 0403-035 The specified path name is too long is because of a LINE_MAX variable.
The issue is that no where have I actually found where this variable is set. I've done grep -i MAX /usr/lib/*.h with no success... (3 Replies)
Greetings,
I am using tcsh to write a script that will replace the numbers in a file with a single number, the caveat is that this file has blank lines which are necessary for another step down the line so I need to preserve the blank lines. I have tried sed and awk but both will collapse the... (1 Reply)
Can someone help me on this. I have a file that has a long line just like below. The long line keeps on being truncated to the next line (new line + space) for some reason. Basically, I just need to remove this problem. Hope somebody can help! Thanks!
INPUT FILE:
structuralObjectClass:... (4 Replies)
Ok, so I am beggining a script to factor the time difference from when a user logs on to current time but before I can even get too far I am getting the INTEGER EXPRESSION EXPECTED error. Can someone tell me what I am doing wrong?
lhour=$(who | grep "$1" | cut -c30,31);
lmin=$(who | grep "$1"... (1 Reply)
Another question for you guys! This is so fun.
So I am playing around with the factor operation. I read in "man factor" that you can actually print a list of primes in between a range, using the syntax
factor ]
However, every time I enter two values, it just returns the factored value.... (1 Reply)
so i have a large file that has many lines in it.
i want to make changes (replace certain things) that are in a range of lines, but NOT the whole file.
how do i do this?
say for instance, if i want to change all the occurrences of the word "ramamama" to "ram cow welcome" in lines 9333 to... (5 Replies)
Hi All,
I have a file with long list of numbers. This file contains only one column. These numbers are very large. I am using following command:
cat myfile.txt | awk '{ sum+=$1} END {print sum}'
The output is coming in scientific notation. How do I get the result in proper format?
... (4 Replies)