Skip to content

How to Find the Sum of Divisors from Prime Factorization

  • Updated: August 8, 2026
📌

Complete guide: Prime Factorization

The sum of the positive divisors of a number can be calculated directly from its prime factorization. Instead of listing every divisor, the exponents in the factorization determine a set of geometric sums whose product gives the result.

Direct Answer

If

n = p1a1 × p2a2 × ··· × pkak,

then the sum of all positive divisors of n is found by multiplying the power sums associated with each prime factor:

σ(n) = (1 + p1 + ··· + p1a1) × ··· × (1 + pk + ··· + pkak).

Sum of Divisors Formula

The sum-of-divisors function is commonly written as σ(n). It includes every positive divisor of n, including 1 and n itself.

Prime Factorization Formula

If n = p1a1 × p2a2 × ··· × pkak, then

σ(n) = ∏ [(piai + 1 − 1) / (pi − 1)].

Each fraction is the closed form of a finite geometric sum:

1 + p + p² + ··· + pa = (pa + 1 − 1) / (p − 1).

The expanded power-sum form is often easier for small numbers. The fraction form is more compact when the exponents are large.

Why the Formula Works

Suppose a positive integer has the prime factorization:

n = pa × qb.

Every positive divisor of n must have the form:

pi × qj,

where 0 ≤ i ≤ a and 0 ≤ j ≤ b. The exponent of p may be chosen from 0 through a, while the exponent of q may be chosen independently from 0 through b.

Adding all possible divisors is therefore equivalent to expanding:

Divisor Choices

(1 + p + p² + ··· + pa)(1 + q + q² + ··· + qb).

Each term produced by the multiplication corresponds to exactly one positive divisor. The same reasoning applies when the factorization contains three or more distinct primes.

Example: Sum of the Divisors of 72

The prime factorization of 72 is:

72 = 2³ × 3².

The powers of 2 that can appear in a divisor are 2⁰, 2¹, 2², and 2³. Their sum is:

1 + 2 + 4 + 8 = 15.

The possible powers of 3 are 3⁰, 3¹, and 3². Their sum is:

1 + 3 + 9 = 13.

Multiplying these two results gives:

Result for 72

σ(72) = 15 × 13 = 195.

The positive divisors of 72 are 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, and 72. Their sum is 195.

Example: Sum of the Divisors of 360

The prime factorization is:

360 = 2³ × 3² × 5.

Powers of 2

1 + 2 + 4 + 8 = 15

Powers of 3

1 + 3 + 9 = 13

Powers of 5

1 + 5 = 6

The divisor sum is the product of these three values:

Result for 360

σ(360) = 15 × 13 × 6 = 1,170.

More Examples

Examples of divisor sums calculated from prime factorizations.
NumberPrime FactorizationPower SumsSum of Divisors
122² × 3(1 + 2 + 4)(1 + 3)28
182 × 3²(1 + 2)(1 + 3 + 9)39
302 × 3 × 5(1 + 2)(1 + 3)(1 + 5)72
491 + 7 + 4957
1002² × 5²(1 + 2 + 4)(1 + 5 + 25)217

Using the Closed Formula

For 72 = 2³ × 3², the geometric-sum formula gives the same result without writing every power separately:

Closed-Form Calculation

σ(72) = [(2⁴ − 1) / (2 − 1)] × [(3³ − 1) / (3 − 1)]

σ(72) = (15 / 1) × (26 / 2) = 15 × 13 = 195.

The exponent in the numerator is one greater than the exponent in the prime factorization. An exponent of 3 produces p4 − 1, while an exponent of 2 produces p3 − 1.

Sum of Proper Divisors

Proper divisors are the positive divisors of a number other than the number itself. Since σ(n) includes n, the sum of the proper divisors is:

Proper Divisor Sum

s(n) = σ(n) − n.

For 72:

s(72) = 195 − 72 = 123.

This distinction is used when classifying numbers as deficient, perfect, or abundant.

Deficient Number

The proper divisor sum is less than the number.

Perfect Number

The proper divisor sum equals the number.

Abundant Number

The proper divisor sum is greater than the number.

For example, 28 = 2² × 7, so:

σ(28) = (1 + 2 + 4)(1 + 7) = 7 × 8 = 56.

Its proper divisor sum is 56 − 28 = 28, which makes 28 a perfect number.

Special Cases

When the Number Is Prime

A prime number p has the factorization . Its only positive divisors are 1 and p, so:

σ(p) = 1 + p.

For example, σ(13) = 1 + 13 = 14.

When the Number Is a Prime Power

If n = pa, only one geometric sum is needed:

σ(pa) = 1 + p + p² + ··· + pa.

For 81 = 3⁴:

σ(81) = 1 + 3 + 9 + 27 + 81 = 121.

When the Number Is Squarefree

A squarefree number has no repeated prime factors. If n = p1p2···pk, then every exponent is 1 and:

σ(n) = (1 + p1)(1 + p2)···(1 + pk).

For 30 = 2 × 3 × 5, the result is 3 × 4 × 6 = 72.

When the Number Is 1

The positive integer 1 has one positive divisor: 1. Therefore, σ(1) = 1. Its prime factorization contains no prime factors, so this case is handled separately in elementary calculations.

Sum of Divisors and Number of Divisors

The formula for adding divisors should not be confused with the formula for counting them. If:

n = p1a1 × ··· × pkak,

then the number of positive divisors is:

τ(n) = (a1 + 1)(a2 + 1)···(ak + 1).

The divisor-count and divisor-sum formulas use the same exponents in different ways.
FunctionWhat It MeasuresFormula for Each Prime Power
τ(n)Number of positive divisorsa + 1
σ(n)Sum of positive divisors1 + p + p² + ··· + pa

For 72, the divisor count is (3 + 1)(2 + 1) = 12, while the divisor sum is 195.

Multiplicative Property

The sum-of-divisors function is multiplicative for coprime positive integers. When gcd(a, b) = 1:

Coprime Product Rule

σ(ab) = σ(a)σ(b).

For example, 8 and 9 are coprime:

σ(8) = 1 + 2 + 4 + 8 = 15

σ(9) = 1 + 3 + 9 = 13

Since 72 = 8 × 9, it follows that:

σ(72) = σ(8)σ(9) = 15 × 13 = 195.

This rule does not apply in the same form when the two numbers share a prime factor. The function is multiplicative, but it is not completely multiplicative.

Common Calculation Mistakes

Using the Wrong Exponent

In the fraction formula, a prime power pa produces the numerator pa + 1 − 1, not pa − 1.

Forgetting the Divisor 1

Every positive integer has 1 as a divisor. Each power sum begins with p⁰ = 1.

Subtracting the Number Too Early

The value σ(n) includes the number itself. Subtract n only when the problem asks for the sum of the proper divisors.

Using an Incomplete Factorization

The formula requires the full prime factorization. A composite factor left unfactored can cause missing powers and an incorrect divisor sum.

Related Concepts

Frequently Asked Questions

Does the sum-of-divisors formula include the number itself?

Yes. The standard function σ(n) includes all positive divisors, including 1 and n.

How is the sum of proper divisors calculated?

Calculate σ(n) and subtract the original number: s(n) = σ(n) − n.

What is the sum of the divisors of a prime number?

A prime number p has only the divisors 1 and p, so its divisor sum is p + 1.

Why are the prime-power sums multiplied?

Each divisor is formed by choosing one allowed exponent for every prime factor. Multiplying the power sums generates every possible combination exactly once.

Is the divisor-sum formula the same as the divisor-count formula?

No. The count formula multiplies the values ai + 1. The sum formula multiplies geometric sums such as 1 + p + p² + ··· + pa.

What is the sum of the positive divisors of 1?

The only positive divisor of 1 is 1, so σ(1) = 1.