Enter the whole number you want to factor. You get the product of primes, the exponent form, the ladder method steps and the number of factors, all at once.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formula
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter a whole number of 2 or more and get its prime factorization on the spot, written as a product such as \(2 \times 2 \times 5 \times 5\)
- The exponent form (\(2^{2} \times 5^{2}\)) and the steps of the ladder method (upside-down division) are shown too
- As an application of prime factorization, it also counts how many factors the number has
- Enter a prime number (a number that cannot be broken down further) and it tells you it is prime, so it also works as a prime number checker
- A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
Even a large fraction such as \(\frac{84}{126}\) can be simplified step by step with prime factorization. \(84 = 2^{2} \times 3 \times 7\) and \(126 = 2 \times 3^{2} \times 7\), so the shared part \(2 \times 3 \times 7 = 42\) is the greatest common factor. Divide both by 42 and you get \(\frac{2}{3}\).
Simplifying fractions, finding common denominators and finding the least common multiple are all built on prime factorization, so it makes every calculation with fractions easier to see through.
RSA encryption, which protects things like credit card numbers, relies on the fact that factoring a very large number takes an enormous amount of time, even for computers. In fact, factoring a 232-digit number (RSA-768) took about two years using hundreds of computers.
A computer can factor a number around 100 trillion (15 digits) in an instant, but the difficulty explodes as the number of digits grows. This gap is what keeps the internet secure.
A gear with 12 teeth and a gear with 18 teeth return to their starting position after 36 teeth have passed, the least common multiple of \(12 = 2^{2} \times 3\) and \(18 = 2 \times 3^{2}\) (3 turns of the small gear and 2 turns of the large one).
Prime factorization is a reliable tool for finding least common multiples, so it is used in designs that spread gear wear evenly and in working out when several cycles line up.
How many ways can 36 people be split into groups of the same size? From \(36 = 2^{2} \times 3^{2}\), the number of factors is \((2+1) \times (2+1) = 9\), so there are 9 ways, from "36 groups of 1" to "1 group of 36".
For teams, tiling or packing products into boxes, whenever you want things to divide evenly, you can count the options without listing them all.
In the eastern United States, some cicadas come out of the ground all at once every 13 or 17 years (periodical cicadas). A prime cycle rarely lines up with other cycles. For example, 13-year cicadas and a predator with a 12-year cycle appear in the same year only once every 156 years, their least common multiple.
A leading hypothesis is that having a prime cycle helped them survive. By working out how rarely the cycles line up with prime factorization, you can check this idea for yourself.
Formula
Symbols and terms
Symbols
| \(n\) | n | The original whole number you want to factor (2 or more). (Example - 100) |
| \(p, q\) | p, q | Prime factors (primes that divide \(n\) evenly). They are written from smallest to largest. (Example - the prime factors of 100 are 2 and 5) |
| \(p^{a}\) | p to the a | The prime factor \(p\) multiplied by itself \(a\) times. The small raised \(a\) is the exponent, which tells you to multiply \(a\) times. (Example - \(2^{2} = 2 \times 2 = 4\)) |
| \(d\) | d | The number of factors. The letter comes from "divisor", another word for factor. (Example - for 100, \(d = 9\)) |
Terms
| prime number | A whole number of 2 or more whose only factors are 1 and itself - 2, 3, 5, 7, 11, 13, … 1 is not a prime number, and 2 is the only even prime number. |
| composite number | A whole number of 2 or more that is not prime. In other words, a number that can be made by multiplying 2 or more primes (example - 100 = 2 × 2 × 5 × 5). |
| prime factor | A prime number that divides a whole number evenly. The prime factors of 100 are 2 and 5. |
| prime factorization | Breaking a whole number into a product of primes only. The result is always the same, apart from the order of the factors. |
| factor (divisor) | A whole number that divides a number evenly. 12 has 6 factors - 1, 2, 3, 4, 6 and 12. |
| exponent | The small raised number that tells how many times to multiply. \(2^{3}\) is 2 multiplied 3 times (\(2 \times 2 \times 2 = 8\)). |
| fundamental theorem of arithmetic | The theorem that every whole number of 2 or more can be written as a product of primes in exactly one way. It is the reason a prime factorization has only one answer. |
| ladder method | A written method that keeps dividing by small primes, also called upside-down division. Write the prime you divide by on the left and the quotient below, and stop when the quotient is a prime. Multiplying all the primes on the left and the last quotient gives back the original number. Many US classrooms also use a factor tree, which reaches the same primes. |
| trial division | A way to factor a number by testing whether it divides evenly by the smallest primes in order - 2, 3, 5, … If nothing up to \(\sqrt{n}\) divides it evenly, the number that is left is prime. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.
| Multiplication facts and division (Grade 3) |
|
| Even and odd numbers, factors and multiples (Grade 4) |
|
| Prime numbers and prime factorization (Grades 4–6) |
|
| Powers and exponents (Grade 6) |
|
How to calculate it in Excel
| Prime factor 1 | 2 |
| Prime factor 2 | 2 |
| Prime factor 3 | 5 |
| Prime factor 4 | 5 |
| Original number n | =B1*B2*B3*B4 |
| Prime factor p | 2 |
| Exponent of p, a | 2 |
| Prime factor q | 5 |
| Exponent of q, b | 2 |
| Original number n | =B1^B2*B3^B4 |
| Exponent of p, a | 2 |
| Exponent of q, b | 2 |
| Number of factors d | =(B1+1)*(B2+1) |
The first table checks that multiplying all the prime factors gives back the original number. B5 shows 2 × 2 × 5 × 5 = 100.
The second table works from the exponent form (2² × 5²). "^" is the symbol for a power (how many times to multiply). B5 shows 100.
The third table finds the number of factors. B3 shows (2+1) × (2+1) = 9. Just replace the prime factors and exponents with your own results.
How to calculate it in Google Sheets
| Prime factor 1 | 2 |
| Prime factor 2 | 2 |
| Prime factor 3 | 5 |
| Prime factor 4 | 5 |
| Original number n | =B1*B2*B3*B4 |
| Prime factor p | 2 |
| Exponent of p, a | 2 |
| Prime factor q | 5 |
| Exponent of q, b | 2 |
| Original number n | =B1^B2*B3^B4 |
| Exponent of p, a | 2 |
| Exponent of q, b | 2 |
| Number of factors d | =(B1+1)*(B2+1) |
How to calculate it in Python
number = 100 # the whole number to factor (2 or more)
prime_factors = [] # list of prime factors, smallest first
remaining = number
divisor = 2
while divisor * divisor <= remaining:
while remaining % divisor == 0: # keep dividing by the same number while it divides evenly
prime_factors.append(divisor)
remaining //= divisor
divisor += 1
if remaining > 1: # whatever is left above 1 is a prime
prime_factors.append(remaining)
print(f"Prime factors of {number}: {prime_factors}")
How to write it in LaTeX and other math languages (copy and paste)
n = p₁ × p₂ × ⋯ × pₖ
n = p_1 \times p_2 \times \cdots \times p_k
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>n</mi>
<mo>=</mo>
<msub><mi>p</mi><mn>1</mn></msub>
<mo>×</mo>
<msub><mi>p</mi><mn>2</mn></msub>
<mo>×</mo>
<mo>⋯</mo>
<mo>×</mo>
<msub><mi>p</mi><mi>k</mi></msub>
</mrow>
</math>
n = p_1 xx p_2 xx cdots xx p_k
FactorInteger[n]
ifactor(n);
factor(n)
n = p_1 × p_2 × ⋯ × p_k
n = pᵃ × qᵇ × ⋯
n = p^{a} \times q^{b} \times \cdots
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>n</mi>
<mo>=</mo>
<msup><mi>p</mi><mi>a</mi></msup>
<mo>×</mo>
<msup><mi>q</mi><mi>b</mi></msup>
<mo>×</mo>
<mo>⋯</mo>
</mrow>
</math>
n = p^a xx q^b xx cdots
p^a * q^b
n := p^a * q^b;
n = p^a * q^b;
n = p^a × q^b × ⋯
d = (a + 1) × (b + 1)
d = (a+1) \times (b+1)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>d</mi>
<mo>=</mo>
<mo>(</mo><mi>a</mi><mo>+</mo><mn>1</mn><mo>)</mo>
<mo>×</mo>
<mo>(</mo><mi>b</mi><mo>+</mo><mn>1</mn><mo>)</mo>
</mrow>
</math>
d = (a + 1) xx (b + 1)
(a + 1)*(b + 1)
d := (a + 1)*(b + 1);
d = (a + 1)*(b + 1);
d = (a + 1) × (b + 1)
How to have ChatGPT do the calculation
You are a calculation assistant for whole numbers. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). Find the prime factorization of 360. 1. List all the prime factors from smallest to largest (repeat a prime factor as many times as it appears) 2. Write it in exponent form (for example, in a form like 2^3 × 3^2 × 5) 3. Also find the number of factors of 360 Show the code you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
