# Factoring Calculator

Oct 18, 2021

Calculate factors of a number, their sum and see which of the factors are prime

Type:
..
The type of the number
Factors:
..
The factors for the input
Sum of Factors:
..
The sum of all the factors
Prime Factors:
..
The prime factors for the input
Prime Factorization:
..
The prime factorization for the input

Factors of a number are the list of all integral numbers that can divide it evenly without leaving any remainders. For example, consider the number 16. The factors of 16 are:

1, 2, 4, 8, 16

16 is completely divisible by these numbers.

• 16 ÷ 1 = 10
• 16 ÷ 2 = 8
• 16 ÷ 4 = 4
• 16 ÷ 8 = 2
• 16 ÷ 16 = 1

#### Example Factors

NumberFactors
31, 3
101, 2, 5, 10
201, 2, 4, 5, 10, 20

All integers have at least two factors, the number 1 and itself. A number that has only two factors is only divisible by itself and 1. These numbers are called prime numbers. Conversely, all numbers with more than two factors are composite numbers.

## Factor Pairs

Factor pairs are the combination of two factors that give the original number when multiplied together. For example, 16 has the following factor pairs:

Factor PairReason
(1, 16)1 × 16 = 16
(2, 8)2 × 8 = 16
(4, 4)4 × 4 = 16

### How to perform factorization

You find out factors of a number by using a trial division. Let's say our number is n.

1. Step 1: Find the square root of n and round it down to the nearest whole number. Let's call this number r. This square root helps us reduce the calculation.
2. Step 2: Begin the trial division with the number 1. All numbers are completely divisible by 1. So, 1 is one of the factors by default. Add the pair (1, n) to our factor pair list.
3. Step 3: Repeat the above process for 2 and see if n is entirely divisible by it. If a remainder is left, we skip the number. Otherwise, we build our factor pair by dividing n by 2 and adding it to our factor pair. We repeat this step for all numbers until we reach the square root we obtained in Step 1.
4. Step 4: At this point, we have the complete factor list. Perform a union on all the numbers in the factor list. The resultant set of numbers are the factors of our original number n.

#### Example Factorization

Consider the number 20.

1. Step 1: The square root of 20 is 4.47. Rounding it down gives us 4.
2. Step 2: 20 is completely divisible by 1. We add (1, 20) to our factor pair list.
3. Step 3: 20 is completely divisible by 2. We add (2, 10) to our factor pair list.
4. Step 4: 20 is not wholly divisible by 3 as we we get a remainder of 2. So, we skip it.
5. Step 5: 20 is completely divisible by 4. We add (4, 5) to our factor pair list.
6. Step 6: We have reached our square root 4 and don't need to iterate any longer. Our factor pairs are:
• (1, 20)
• (2, 10)
• (4, 5)
7. Step 7: Performing a union on all the numbers in the factor pairs gives us: 1, 2, 4, 5, 10, 20. This list contains all the Factors for the number 20.