Enter one positive integer to find its factors. The list of factors, the number of factors, the factor pairs and the prime factorization are all calculated 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 one positive integer, and all of its factors are listed from smallest to largest (none missed, none repeated)
- You also get the factor pairs (pairs that multiply to the number) and the number of factors at the same time
- The prime factorization (in a form like \(120 = 2 \times 2 \times 2 \times 3 \times 5\)) is shown too, with each division step
- If the only factors are 1 and the number itself, it is a prime number, so you can also use this page to check whether a number is prime
- A plain-language explanation of how to find factors and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
To simplify \(\frac{24}{36}\), find a factor that the numerator 24 and the denominator 36 share, and divide both by it (divide by their greatest common factor, 12, and you get \(\frac{2}{3}\) in one step).
Once factors come to mind quickly, simplifying fractions, finding common denominators and simplifying ratios all become faster and more accurate. Many students who struggle with fractions are really struggling with this sense of factors.
If you want to hand out 120 cookies so that everyone gets the same number with none left over, the possible numbers of people are exactly the factors of 120 (1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 24, 30, 40, 60, 120).
Splitting a class into teams, filling goody bags, sharing supplies equally: listing the factors gives you every option for "how many people (or bags) can share this evenly".
The ways to arrange 36 tiles into a rectangle with none left over are exactly the factor pairs: 1×36, 2×18, 3×12, 4×9 and 6×6, five in all.
Laying out floor or wall tiles, arranging products on a shelf, setting up chairs for a ceremony: whenever a fixed number of items goes into a rectangle, the factor pairs are your layout options.
Prime factorization takes an instant for numbers of about 14 digits, but for huge numbers hundreds of digits long, it cannot be finished in any realistic time, even with all the computers in the world. RSA encryption, widely used on the internet, relies on this fact: "big numbers cannot be factored in practice".
When you send your card number to an online store, prime factorization, the same thing this page does, is at the root of what keeps your information safe.
If the tooth counts of two meshing gears share a factor, the same teeth keep meeting the same partners, so wear and damage tend to build up on certain teeth. That is why machine designers often choose tooth counts that share no factor other than 1 (that are relatively prime).
From car transmissions to wristwatches, whether two numbers share a factor affects how long a product lasts.
Formula
Symbols and terms
Symbols
| \(N\) | N | The positive integer whose factors you want. (Example - 120) |
| \(A,\ B\) | A, B | A pair of factors that multiply to \(N\). (Example - the 4 and 30 in \(120 = 4 \times 30\)) |
| \(p,\ q,\ r\) | p, q, r | The primes in a prime factorization (the prime factors). (Example - the 2, 3 and 5 in \(120 = 2^3 \times 3 \times 5\)) |
| \(a,\ b,\ c\) | a, b, c | How many times each prime is multiplied in the prime factorization (the exponents). In the number-of-factors formula, you add 1 to each and multiply the results. (Example - for \(120 = 2^3 \times 3 \times 5\), 2 is multiplied \(a = 3\) times, and 3 and 5 are each multiplied \(b = c = 1\) time) |
| \(2^{3}\) | 2 to the third power (2 cubed) | 2 multiplied by itself 3 times (\(2 \times 2 \times 2 = 8\)). The small raised number (the exponent) tells how many times to multiply. |
| \(d(N)\) | d of N | The number of factors of \(N\). The d comes from "divisor", another word for factor. (Example - \(d(120) = 16\)) |
| \(\sqrt{N}\) | square root of N | The number that gives \(N\) when squared (the square root). In every factor pair, one factor is at most \(\sqrt{N}\), so checking up to here is enough to find all the factors. |
Terms
| factor | A positive integer that divides a given integer evenly (with no remainder). Example - the factors of 30 are 1, 2, 3, 5, 6, 10, 15 and 30, eight in all. 1 and the number itself are always factors of any number. |
| multiple | A number you get by multiplying an integer by a whole number (1 times, 2 times, 3 times and so on). Factors and multiples are two sides of the same coin: "4 is a factor of 120" and "120 is a multiple of 4" say the same thing. |
| prime number | An integer of 2 or more whose only factors are 1 and itself. In order they are 2, 3, 5, 7, 11, 13 and so on, without end. 1 is not a prime number. |
| composite number | An integer of 2 or more that is not prime. It has 3 or more factors and can be broken down into a product of primes. (1 is neither prime nor composite.) |
| prime factor | A prime number that divides a given integer evenly. Example - the prime factors of 120 are 2, 3 and 5, three in all. |
| prime factorization | Writing an integer as a product of prime numbers only. Example - \(120 = 2 \times 2 \times 2 \times 3 \times 5\). There is only one way to do it (apart from the order of the factors). |
| divisor | Another word for factor in this sense. In school math, "factor" is the usual word; in number theory, "divisor" is common, and the d in \(d(N)\) comes from it. This page uses "factor" throughout. (In a division such as \(120 \div 4\), the number you divide by is also called the divisor.) |
| perfect square | A number you get by multiplying an integer by itself. Example - \(36 = 6 \times 6\) and \(3600 = 60 \times 60\). A perfect square always has an odd number of factors (because the pair of equal numbers is counted only once). |
| exponent (power) | A way to write the same number multiplied by itself many times. In \(2^3\), the small raised number (the exponent) tells how many times to multiply. |
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.
| Multiplication facts and division (Grades 3–4) |
|
| Factors and multiples (Grade 4) |
|
| Prime numbers and prime factorization (Grades 4–6) |
|
| Exponents (Grade 6) |
|
How to calculate it in Excel
| Number to factor N | 120 |
| Number to test A | 4 |
| Remainder of N ÷ A (0 = it is a factor) | =MOD(B1,B2) |
| Partner factor B (when the remainder is 0) | =B1/B2 |
| Prime factor 1 | 2 |
| Prime factor 2 | 2 |
| Prime factor 3 | 2 |
| Prime factor 4 | 3 |
| Prime factor 5 | 5 |
| Product of all (correct if it gives back the number) | =PRODUCT(B1:B5) |
| Times prime p is multiplied, a | 3 |
| Times prime q is multiplied, b | 1 |
| Times prime r is multiplied, c | 1 |
| Number of factors d(N) | =(B1+1)*(B2+1)*(B3+1) |
The second table checks a prime factorization. PRODUCT(B1:B5) multiplies everything from B1 to B5, so if B6 shows 120, the factorization is correct (for a number with fewer than 5 prime factors, enter 1 in the unused cells).
The third table is the number-of-factors formula. B4 shows (3+1)×(1+1)×(1+1) = 16.
How to calculate it in Google Sheets
| Number to factor N | 120 |
| Number to test A | 4 |
| Remainder of N ÷ A (0 = it is a factor) | =MOD(B1,B2) |
| Partner factor B (when the remainder is 0) | =B1/B2 |
| Prime factor 1 | 2 |
| Prime factor 2 | 2 |
| Prime factor 3 | 2 |
| Prime factor 4 | 3 |
| Prime factor 5 | 5 |
| Product of all (correct if it gives back the number) | =PRODUCT(B1:B5) |
| Times prime p is multiplied, a | 3 |
| Times prime q is multiplied, b | 1 |
| Times prime r is multiplied, c | 1 |
| Number of factors d(N) | =(B1+1)*(B2+1)*(B3+1) |
How to calculate it in Python
n = 120 # the positive integer to factor
divisors = [] # list of factors
pairs = [] # factor pairs that multiply to n
i = 1
while i * i <= n: # dividing by numbers up to √n finds them all
if n % i == 0: # remainder 0: i is a factor
divisors.append(i)
if i != n // i: # its partner is a factor too (skip the repeat in a square like 6×6)
divisors.append(n // i)
pairs.append((i, n // i))
i += 1
divisors.sort()
prime_factors = [] # prime factorization (keep dividing by the smallest prime while it divides evenly)
rest = n
p = 2
while p * p <= rest:
while rest % p == 0:
prime_factors.append(p)
rest = rest // p
p += 1
if rest > 1:
prime_factors.append(rest) # whatever is left at the end is a prime factor too
print(f"Factors of {n} ({len(divisors)} in total): {divisors}")
print(f"Factor pairs: {pairs}")
if len(prime_factors) >= 2:
print(f"Prime factorization: {n} = {' × '.join(map(str, prime_factors))}")
elif len(prime_factors) == 1:
print(f"{n} is a prime number")
How to write it in LaTeX and other math languages (copy and paste)
N = A × B
N = A \times B
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>N</mi>
<mo>=</mo>
<mi>A</mi>
<mo>×</mo>
<mi>B</mi>
</mrow>
</math>
N = A xx B
A*B
N := A*B;
N = A*B;
N = A × B
N = pᵃ × qᵇ × rᶜ × …
N = p^{a} \times q^{b} \times r^{c} \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>
<msup><mi>r</mi><mi>c</mi></msup>
<mo>×</mo>
<mo>⋯</mo>
</mrow>
</math>
N = p^a xx q^b xx r^c xx cdots
p^a*q^b*r^c
N := p^a*q^b*r^c;
N = p^a*q^b*r^c;
N = p^a × q^b × r^c × …
d(N) = (a + 1)(b + 1)(c + 1) …
d(N) = (a+1)(b+1)(c+1)\cdots
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>d</mi><mo>(</mo><mi>N</mi><mo>)</mo>
<mo>=</mo>
<mo>(</mo><mi>a</mi><mo>+</mo><mn>1</mn><mo>)</mo>
<mo>(</mo><mi>b</mi><mo>+</mo><mn>1</mn><mo>)</mo>
<mo>(</mo><mi>c</mi><mo>+</mo><mn>1</mn><mo>)</mo>
<mo>⋯</mo>
</mrow>
</math>
d(N) = (a+1)(b+1)(c+1) cdots
(a + 1)*(b + 1)*(c + 1)
d := (a + 1)*(b + 1)*(c + 1);
d = (a + 1)*(b + 1)*(c + 1);
d(N) = (a+1)(b+1)(c+1)…
How to have ChatGPT do the calculation
You are a calculation assistant for integers. 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). For 120, find each of the following: 1. All factors, listed from smallest to largest, and how many there are 2. All factor pairs that multiply to 120 3. The prime factorization (in a form like 2 × 2 × 2 × 3 × 5) 4. A check with the number-of-factors formula (add 1 to how many times each prime is multiplied, and multiply the results) that it matches the count in item 1 Show the code you used and 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.
