Distinct Prime Factor Calculator
Count how many different primes divide an integer, with the total count and a squarefree check beside it.
What it does
Small omega counts how many different primes divide an integer. The number 12 has prime factorization two squared times three, so its distinct primes are two and three and small omega is two. Repeated occurrences do not add to the count.
The function is written with a lowercase Greek omega and pairs naturally with big Omega, which counts every occurrence. Their difference is a quick measure of repetition in a factorization: equal values mean no prime repeats, while a gap means at least one squared factor.
This function is completely additive, so the value for a product of coprime numbers is the sum of their values. It also determines several other quantities: the number of squarefree divisors is two raised to this count, and the radical is the product of exactly these primes.
This page factors the input, counts the distinct primes and reports the total prime factor count and a squarefree flag beside it. The comparison is exact, since both counts come from the same factorization.
The input limit is one trillion. Results are small nonnegative integers, and the tool returns a clear error for values outside the range.
How to use
- Enter a whole number n from 1 upward.
- Read the distinct prime factor count in the main result box.
- Compare it with the count that includes repeats.
- Use the squarefree flag to test for repeated primes.
- The default n = 30 reproduces the worked example.
- Try n = 12 to see the two counts differ.
Formula
- n
- The positive integer being factored.
- r
- The number of distinct prime divisors.
- omega(n)
- The small omega value at n.
Each exponent a_i is at least one, but its size never changes the count. For n = 1 there are no prime factors and omega(1) = 0. The number is squarefree exactly when omega(n) equals Omega(n), the count with multiplicity.
Worked example
Example: omega(30)
The page opens with n = 30.
- Factor 30 into 2 x 3 x 5.
- List the distinct primes: 2, 3 and 5.
- Count them: there are 3 distinct primes.
- Count with multiplicity: each exponent is 1, so big Omega is also 3.
- The tool reports small omega 3, big Omega 3, and squarefree Yes.
- For 12 the factorization 2^2 x 3 gives omega 2 but big Omega 3, so the flag would be No.
Reference table
| n | Factorization | omega(n) | Omega(n) | Squarefree |
|---|---|---|---|---|
| 1 | none | 0 | 0 | Yes |
| 4 | 2^2 | 1 | 2 | No |
| 8 | 2^3 | 1 | 3 | No |
| 12 | 2^2 x 3 | 2 | 3 | No |
| 30 | 2 x 3 x 5 | 3 | 3 | Yes |
| 36 | 2^2 x 3^2 | 2 | 4 | No |
Limits
- Only positive integers are accepted.
- Inputs above one trillion are rejected to keep factoring responsive.
- The squarefree flag follows from the two counts and uses no external table.
- The tool reports counts, not the prime list itself.
Common mistakes
- Counting a repeated prime twice.
- Treating omega(1) as one instead of zero.
- Assuming a larger number always has more distinct primes.
- Confusing this with the count of all divisors.
- Expecting the squarefree flag to depend on the size of the exponents rather than their repetition.
Try it yourself
Quick checks. Answers sit tucked under each question.
How many distinct primes does 12 have?
Two, namely 2 and 3, so omega(12) = 2 while Omega(12) = 3.
How many distinct primes does 8 have?
Only the prime 2 appears, so omega(8) = 1.
Is 30 squarefree?
Yes. Its factorization 2 x 3 x 5 gives omega 3 and Omega 3, which match.
Questions
Why use a lowercase omega?
The lowercase symbol is the traditional notation for distinct prime factors, while the uppercase symbol counts with multiplicity.
What is omega(1)?
It is zero because the number 1 has no prime divisors.
How does this determine the radical?
The radical is the product of exactly these distinct primes.
How does it determine squarefree divisors?
There are two raised to the omega count of squarefree divisors, since each prime may be chosen or skipped.
Is the function additive?
Yes. For coprime numbers the value of the product is the sum of the values.
What input range does this page accept?
Whole numbers from 1 through 1,000,000,000,000.