Home / Blog / Math & Scientific

Math & Scientific

Count Prime Factors: Distinct, Repeated and Divisors

Distinguish distinct prime factors from factors counted with multiplicity, use exponent notation, and avoid confusing prime-factor counts with divisor counts.

Count Prime Factors: Distinct, Repeated and Divisors

Clarify what the requested count includes

The phrase number of prime factors can mean distinct prime values or a count that includes repeated occurrences. For 72 = 2×2×2×3×3 = 2^3×3^2, the distinct prime factors are two and three, giving a count of 2. Counting with multiplicity gives 3+2 = 5. Both answers are valid for their respective definitions, so a worksheet or program should state which convention it wants before a bare number is reported.

Factor the integer and count the repeated factors

Enter 72 in the Prime Factorization Calculator. Its factorization line lists 2 × 2 × 2 × 3 × 3. Counting those five entries gives the multiplicity count directly. To obtain the distinct count, remove repetitions and count the remaining values. The form also displays a list of divisors, which is separate information. A divisor such as six is not prime even though it divides 72, so counting all displayed divisors would answer another question.

Use exponent notation for a larger example

For 360, repeated division gives 2^3×3^2×5. There are three distinct prime factors: two, three and five. The multiplicity count is 3+2+1 = 6. Every positive integer greater than one has a unique prime factorization apart from rearranging the factor order, so these counts do not depend on which valid factor tree was chosen. One tree may split 360 as 36×10 and another as 8×45; complete factorization leads to the same exponents.

Distinguish the number of positive divisors

If n = p1^a1 × p2^a2 × ... × pk^ak, the number of positive divisors is (a1+1)(a2+1)...(ak+1). For 72, this is (3+1)(2+1) = 12. Each divisor chooses an exponent from zero through three for two and zero through two for three. This formula includes one and the number itself. It gives neither the distinct prime count 2 nor the multiplicity count 5. Naming all three quantities prevents a correct divisor formula from being used for the wrong requested count.

Check prime numbers, prime powers and one

For a prime such as 13, the factorization consists of 13 once, so both prime-factor counts equal one. For 64 = 2^6, there is one distinct prime and six prime factors with multiplicity. The number one has no prime factors, so both counts are zero; its single positive divisor is one. One is not a prime, because a prime has exactly two distinct positive divisors. Treating one as another prime factor would destroy uniqueness by allowing arbitrarily many extra factors of one.

Keep the integer domain explicit

The usual prime-factorization count concerns positive integers. For a negative integer, one can factor its positive magnitude and record a separate factor of −1, but −1 is not prime. Zero has no finite prime factorization and is outside this counting method. Noninteger decimals need a different problem statement, such as factoring the numerator and denominator of a reduced rational number. The local form caps the magnitude it factors at one billion; it is a practical integer factorization tool, not a general symbolic factorization system.

Verify the factorization before trusting the count

For 360, multiplying 8×9×5 returns 360. If a proposed factorization were 2^2×3^2×5, it would multiply to 180 and its count would be based on a missing factor of two. Also verify that every listed base is prime; writing 360 = 6^2×10 does not yet give prime exponents. These two checks, correct product and prime bases, establish that the distinct and repeated counts are being taken from a complete factorization rather than a partially factored expression.

Calculator for the supported step

Use the Prime Factorization Calculator to list the prime factors of a positive integer. A primality test only says whether the integer is prime; it does not by itself count all prime factors. For negative input, it factors the positive magnitude. Its divisor count covers all divisors, but the visible divisor list is limited to the first fifty.

Open Prime Factorization Calculator

Sources and method

OpenStax: prime factorization and least common multiples