factor Command

Purpose

Factors a number.

Syntax

factor [ Number ]

Description

When called without specifying a value for the Number parameter, the factor command waits for you to enter a positive number less than 1E14 (100,000,000,000,000). It then writes the prime factors of that number to standard output. It displays each factor the proper number of times. To exit, enter 0 or any nonnumeric character.

When called with an argument, the factor command determines the prime factors of the Number parameter, writes the results to standard output, and exits.

Examples

To calculate the prime factors of 123, enter:

factor 123

The following is displayed:

123
     3
     41

Files

Item Description
/usr/bin/factor Contains the factor command.