FACTOR(1) HP-UX 5.0 FACTOR(1) NAME factor, primes - factor a number, generate large primes SYNOPSIS factor [ number ] primes [ start [ stop ] ] HP-UX COMPATIBILITY Level: HP-UX/STANDARD Origin: System V DESCRIPTION When factor is invoked without an argument, it waits for a number to be typed in. If you type in a positive number, it factors the number and prints 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. The largest number that can be dealt with by factor is 1.0e14. Primes prints prime numbers between a lower and upper bound. If primes is invoked without any arguments, it waits for two numbers to be typed in. The first number is interpreted as the lower bound, and the second as the upper bound. All prime numbers in the resulting inclusive range are printed. If start is specified, all primes greater than or equal to start are printed. If both start and stop are given, then all primes occurring in the inclusive range "start - stop" are printed. Start and stop values must be integers represented as long integers. If the stop value is omitted in either case, primes runs until either overflow occurs or it is stopped by typing interrupt. The largest number that can be dealt with by primes is 2,147,483,647. DIAGNOSTICS ``Ouch'' when the input is out of range, for garbage input, or when start is greater than stop.