# What are the factors of a number?

Lists every factor of a whole number, its factor pairs, and its prime factorization, and says whether it is prime.

- Page: https://www.acalculator.org/math/factor-calculator
- JSON spec: https://www.acalculator.org/math/factor-calculator.json
- Version: df1627f5805c

## Default answer

Example with the default inputs (Whole number 60): The factors of 60 (12 in all) are 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| n | Whole number | The whole number to factor, from 1 to 1,000,000,000,000. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| factors | Factors | Every whole number that divides n with no remainder, smallest first. |
| count | Number of factors | How many factors n has. |
| pairs | Factor pairs | Pairs of factors that multiply to n, such as 3 × 20 for 60. |
| primeFactorization | Prime factorization | n written as a product of primes, with powers: 60 = 2² × 3 × 5. |
| prime | Prime number? | Yes when n has exactly two factors, 1 and itself. |
| sum | Sum of the factors | All the factors added together, n included. |

## Method

Trial division: divide n by 2, 3, 5, 7, … up to √n for the prime factorization, then list every product of the prime powers.

## Assumptions

- n is a whole number from 1 to 1,000,000,000,000 (10¹²).
- Only positive factors are listed; each negative factor −f also divides n.
- 1 is not a prime number.

## Worked examples

1. n = 60 gives factors = 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60, count = 12, pairs = 1 × 60, 2 × 30, 3 × 20, 4 × 15, 5 × 12, 6 × 10, primeFactorization = 2² × 3 × 5, prime = no, sum = 168. Source: hand calculation in content.mdx: 60 = 2² × 3 × 5, (2 + 1)(1 + 1)(1 + 1) = 12 factors.
2. n = 97 gives factors = 1, 97, count = 2, pairs = 1 × 97, primeFactorization = 97, prime = yes, sum = 98. Source: hand calculation in content.mdx: no prime up to √97 ≈ 9.8 (2, 3, 5, 7) divides 97.
3. n = 36 gives factors = 1, 2, 3, 4, 6, 9, 12, 18, 36, count = 9, pairs = 1 × 36, 2 × 18, 3 × 12, 4 × 9, 6 × 6, primeFactorization = 2² × 3². Source: hand calculation in content.mdx: 36 = 2² × 3², a perfect square with an odd number of factors.
4. n = 1 gives factors = 1, count = 1, pairs = 1 × 1, primeFactorization = 1, prime = no, sum = 1. Source: hand calculation in content.mdx: 1 has one factor and is not prime.
5. n = 1,000,000,000,000 gives count = 169, primeFactorization = 2¹² × 5¹², sum = 2,499,694,822,171. Source: hand calculation in content.mdx: 10¹² = 2¹² × 5¹², (12 + 1)(12 + 1) = 169 factors; Python 3: (2**13 - 1) * (5**13 - 1) // 4 = 2499694822171.
6. n = 999,999,999,989 gives count = 2, prime = yes. Source: Python 3 trial division: no divisor of 999,999,999,989 from 2 to 999,999 (the largest prime below 10¹²).

## FAQ

### What are the factors of a number?

The whole numbers that divide it with no remainder. The factors of 12 are 1, 2, 3, 4, 6 and 12, because 12 ÷ each of them is a whole number. Every whole number has 1 and itself as factors.

### How do I find all the factors of a number?

Try each whole number from 1 up to the square root of the number. Each one that divides it gives a factor pair. For 60, √60 ≈ 7.7, and 1, 2, 3, 4, 5 and 6 divide it, giving the pairs 1 × 60, 2 × 30, 3 × 20, 4 × 15, 5 × 12 and 6 × 10.

### What is a prime factorization?

The number written as a product of prime numbers, which is the same for every number whichever way you find it. 60 = 2 × 2 × 3 × 5, written 2² × 3 × 5. You can find it by dividing by the smallest prime that fits, again and again: 60 ÷ 2 = 30, 30 ÷ 2 = 15, 15 ÷ 3 = 5, and 5 is prime.

### How can I count the factors without listing them?

Add 1 to each power in the prime factorization and multiply. 60 = 2² × 3¹ × 5¹, so it has (2 + 1) × (1 + 1) × (1 + 1) = 12 factors.

### What is a prime number?

A whole number greater than 1 whose only factors are 1 and itself, such as 2, 3, 5, 7, 11 and 97. A number with more factors is composite. 1 is neither, because it has only one factor.

### Why do some numbers have an odd number of factors?

Factors come in pairs that multiply to the number, except when both numbers in a pair are the same. That happens only for perfect squares: 36 has the pair 6 × 6, so it has 9 factors, an odd number.

### What about negative factors?

Each factor f also has a negative partner −f that divides the number, since (−f) × (−n ÷ f) = n. By convention, lists of factors show only the positive ones, as this calculator does.

## Sources

- OpenStax, Prealgebra 2e, section 2.4 Find Multiples and Factors: https://openstax.org/books/prealgebra-2e/pages/2-4-find-multiples-and-factors
- OpenStax, Prealgebra 2e, section 2.5 Prime Factorization and the Least Common Multiple: https://openstax.org/books/prealgebra-2e/pages/2-5-prime-factorization-and-the-least-common-multiple
