Distinct Prime Factor Count

Return ω(n), the number of distinct prime factors, with ω(1)=0 and trial division limited to n≤10¹².

Description

The arithmetic function ω(n) counts distinct prime divisors.

The arithmetic function ω(n) counts distinct prime divisors. Repeated occurrences of the same prime contribute only one to this count.1

The tool returns count. The indexing and output conventions below determine how to read these values.

When to use Distinct Prime Factor Count

Use this for the following task: Return ω(n), the number of distinct prime factors, with ω(1)=0 and trial division limited to n≤10¹². Use the input and output conventions below to reproduce the intended mathematical quantity.

How to use Distinct Prime Factor Count and understand its results

  1. Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
  2. Enter n according to the field table, then run the tool.
  3. Read count. Use the stated units, indexing and interpretation of the numerical result.
  4. Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
Input fieldMeaningValue type and boundsRequirement
nPositive integer (trial-division resource limit 10^12)integer; minimum 1; maximum 1000000000000Required

Factor positive n by trial division and return the length of the distinct-prime factor list. One has an empty factorization and returns zero.

ω(n)=number of distinct primes in the factorization of n

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
countNumber of distinct prime factorsinteger
json
{
  "input": {
    "n": 72
  },
  "output": {
    "count": 2
  }
}

Limitations and assumptions

The candidate is capped at 10¹². Use the multiplicity-counting Ω tool when exponents should contribute separately.

Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.

Alternative or Complementary methods

Choose Prime Factor Count with Multiplicity when you need its operation: Return Ω(n), the total number of prime factors counting their exponents, with Ω(1)=0 and trial division limited to n≤10¹². Choose Sphenic Number Checker for the complementary operation: Check whether n is the product of exactly three distinct primes, each with exponent one; trial division is limited to n≤10¹².

Background reference: Digital Library of Mathematical Functions, §27.2.

References

  1. Digital Library of Mathematical Functions, §27.2 — National Institute of Standards and Technology

Similar or alternative tools

  • Prime Factor Count with Multiplicity

    Return Ω(n), the total number of prime factors counting their exponents, with Ω(1)=0 and trial division limited to n≤10¹².

  • Sphenic Number Checker

    Check whether n is the product of exactly three distinct primes, each with exponent one; trial division is limited to n≤10¹².

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies