Distinct Prime Factor Calculator

Count how many different primes divide an integer, with the total count and a squarefree check beside it.

Math and PercentUpdated 2026-11-182 min read
Distinct Prime Factor Calculator
A whole number from 1 to 1,000,000,000,000.
Distinct prime factors
...
Prime factors with multiplicity...
Squarefree...

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

  1. Enter a whole number n from 1 upward.
  2. Read the distinct prime factor count in the main result box.
  3. Compare it with the count that includes repeats.
  4. Use the squarefree flag to test for repeated primes.
  5. The default n = 30 reproduces the worked example.
  6. Try n = 12 to see the two counts differ.

Formula

omega(n) = r when n = p1^a1 x p2^a2 x ... x pr^ar with distinct primes p_i
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.

  1. Factor 30 into 2 x 3 x 5.
  2. List the distinct primes: 2, 3 and 5.
  3. Count them: there are 3 distinct primes.
  4. Count with multiplicity: each exponent is 1, so big Omega is also 3.
  5. The tool reports small omega 3, big Omega 3, and squarefree Yes.
  6. For 12 the factorization 2^2 x 3 gives omega 2 but big Omega 3, so the flag would be No.

Reference table

Distinct and total prime factors
nFactorizationomega(n)Omega(n)Squarefree
1none00Yes
42^212No
82^313No
122^2 x 323No
302 x 3 x 533Yes
362^2 x 3^224No

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.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.