FACTOR(1) General Commands Manual FACTOR(1)NAME
factor, primes - factor a number, generate large primes
factor [ number ]
When factor is invoked without an argument, it waits for a number to be typed in. If you type in a positive number less than 256 (about
7.2e16) it will factor the number and print its prime factors; each one is printed the proper number of times. Then it waits for another
number. It exits if it encounters a zero or any non-numeric character.
If factor is invoked with an argument, it factors the number as above and then exits.
Maximum time to factor is proportional to sqrt(n) and occurs when n is prime or the square of a prime. It takes 1 minute to factor a prime
near 1014 on a PDP11.
When primes is invoked, it waits for a number to be typed in. If you type in a positive number less than 256 it will print all primes
greater than or equal to this number.
`Ouch.' for input out of range or for garbage input.
Check Out this Related Man Page
factor(1) General Commands Manual factor(1)NAME
factor, primes - factor a number, generate large primes
If no arguments are provided on the command line, waits for a number to be typed in. If a positive number is typed, it factors the number
and print its prime factors; each one is printed the proper number of times. It then waits for another number. exits if it encounters a
zero or any non-numeric character.
If an argument is provided on the command line, factors the number as above, then exits.
Maximum time to factor is proportional to sqrt(n) and occurs when n is prime or the square of a prime.
The largest number that can be dealt with by is 1.0e14.
prints prime numbers between a lower and upper bound. If no arguments are provided on the command line, waits for two numbers to be typed
in. The first number is interpreted as the lower bound; the second as the upper bound. All prime numbers in the resulting inclusive range
If start is specified, all primes greater than or equal to start are printed. If both start and stop are given, all primes occurring in
the inclusive range start through stop are printed.
start and stop values must be integers represented as long integers.
If the stop value is omitted in either case, runs either until overflow occurs or until it is stopped by typing the interrupt character.
The largest number that can be dealt with by is 2,147,483,647.
Both commands print when the input is out of range, illegal characters are encountered, or when start is greater than stop.
Print the prime factorization for the number 12:
Print all prime numbers between 0 and 20:
I just inst freeBSD boot installation and it didnt work for(probably my lack of knowledge) reasons but i now have to partitions in freeBSD and i really need them back for windows at the moment. i just cant find them. The bad thing is that i only got this bundled version of windows so i cant really... (2 Replies)
I have been working with java for awhile and because of my school projects I needed to switch C++. I tried to implement some patterns in C++ but unfortunately I couldn't. Specifically, I tried to implement abstract factory pattern but since I used separated files (habitual behavior from... (4 Replies)
Can someone please help me with this SHELL script?
I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1.
Here is a start but I have no clue how to... (3 Replies)
I am trying to run the factorial script but it’s not working.
The code is mentioned below:
/home/gc> cat fact.sh
# using one command line parameter
for (( number = 1; number <= $1 ;... (3 Replies)
I am completely new to Shell scripting and I have almost no idea what I'm doing here. I'm not a stranger at all to programming, but the way SHELL is done drives me to insanity. Here's my current issue:
1. We are to create a BASH script called rafactor.sh
This program takes in two (or three)... (6 Replies)
I have a table like this:
# are just some numbers. I want to have the output like this:
* 1 2 3
A # # NA
B # NA #
C # # NA
D NA # #
E NA # NA
So basically, I wanna know in each of the rows in my input (which... (9 Replies)
While doing some checks I found a kind of interesting arithmetic factorial chart with sed, sharing this may be simple but thought to share,
# n=20;for i in `seq $n`;do printf "`seq $i|xargs|sed 's/ /*/g'`= ";echo "`seq $i|xargs|sed 's/ /*/g'`"| bc;done
1*2*3= 6... (6 Replies)
Is anyone here familiar with implementing multi-factor authentication on HP-UX 11.31? Either with a PIV card, or with an RSA token? We've been tasked with implementing this on our servers, but I'm not finding much in the way of products or information. To complicate matters, our servers are... (6 Replies)
I have a factor program that runs and outputs to stdout all the prime numbers that are specified in the given paramters, in this case 30000000-31000000.
30999979 = 30999979
30999980 = 2^2 5 11 140909
30999981 = 3 10333327... (6 Replies)
Which basically means the ldoms that were on there are not starting (not even showing).
If I do ldm list-config it shows live config as next reboot. But, of course, next reboot it reverts back to factory default again.
I must admit I'm wondering if its doing this becasue (with the... (3 Replies)
I have Google Two Factor (2F) Authentication enabled for sshd on most of my Linux servers. This works well and I highly recommend it.
My question is:
Has anyone set this up for rsync which runs in a crontab?
For example, supposed we have this simple crontab script:
... (5 Replies)