Skip to main content

Sum of Divisors Calculator

Mathematics - Sum of Divisors

Sum of Divisors Calculator

Calculate the sum of all divisors of any positive integer with step-by-step explanation. Learn the σ(n) formula using prime factorization, understand proper divisors, and explore perfect, abundant, and deficient numbers.

Calculate the Sum of Divisors

Enter a positive integer to find the sum of all its divisors. Click Calculate for step-by-step working using prime factorization.

Divisor sum will appear here.
Note: The divisor function σ(n) (sigma) calculates the sum of all positive divisors of n. Using prime factorization n = p₁ᵃ¹ × p₂ᵃ² × ..., the formula is: σ(n) = Π[(pᵢ^(aᵢ+1) - 1) / (pᵢ - 1)]. The sum of proper divisors excludes n itself: s(n) = σ(n) - n.

Sum of Divisors – Complete Explanation

The sum of divisors function σ(n) (sigma) adds up all positive integers that divide evenly into n. This includes 1 and n itself. The closely related aliquot sum s(n) = σ(n) - n sums only the proper divisors (excluding n). These functions are central to the classification of numbers as perfect, abundant, or deficient, and have been studied since ancient Greek mathematics.

Divisor Sum Formula

If n = p₁a₁ × p₂a₂ × ... × pₖaₖ

σ(n) = Π[(pᵢaᵢ+1 - 1) / (pᵢ - 1)]

For a single prime power pe: σ(pe) = (pe+1 - 1) / (p - 1)

Example: 12 = 2² × 3¹ → σ(12) = [(2³-1)/(2-1)] × [(3²-1)/(3-1)] = 7 × 4 = 28.

1. What Is the Sum of Divisors?

σ(n) answers the question: "What is the total when you add up all the numbers that divide evenly into n?" It's one of the most important arithmetic functions in number theory.

Key facts:

  • σ(1) = 1: 1 has only one divisor (itself).
  • σ(p) = p + 1: For a prime p, the divisors are 1 and p.
  • σ(n) = 2n: When n is a perfect number (e.g., σ(28) = 56 = 2×28).
  • σ is multiplicative: If a and b are coprime, σ(ab) = σ(a) × σ(b).

2. The Divisor Sum Formula Explained

The formula works by summing each prime power's geometric series independently, then multiplying the results:

For n = 12 = 2² × 3¹:

Divisors come from combining 2⁰, 2¹, 2² with 3⁰, 3¹.

Sum of powers of 2: 1 + 2 + 4 = 7 = (2³-1)/(2-1)

Sum of powers of 3: 1 + 3 = 4 = (3²-1)/(3-1)

σ(12) = 7 × 4 = 28

This works because every divisor is formed by picking one term from each prime's geometric series and multiplying them together.

3. How to Calculate σ(n)

The systematic approach:

  1. Prime factorize the number: n = p₁ᵃ¹ × p₂ᵃ² × ...
  2. For each prime power pᵉ: Calculate (pᵉ⁺¹ - 1) / (p - 1) — this is the sum of the geometric series 1 + p + p² + ... + pᵉ.
  3. Multiply all these sums together — the product is σ(n).
  4. For proper divisor sum s(n): Subtract n from σ(n).

4. Step-by-Step Examples

Example 1: Sum of Divisors of 28 (Perfect Number)

Calculate σ(28) — the sum of all divisors of 28.

Step 1: Prime factorize 28:
        28 = 2 × 2 × 7 = 2² × 7¹

Step 2: Apply the formula for each prime power:
        For 2²: (2³ - 1) / (2 - 1) = (8 - 1) / 1 = 7
        For 7¹: (7² - 1) / (7 - 1) = (49 - 1) / 6 = 48/6 = 8

Step 3: Multiply:
        σ(28) = 7 × 8 = 56

Step 4: Proper divisor sum:
        s(28) = 56 - 28 = 28
        Since s(28) = 28, this is a PERFECT NUMBER!

Verification: 1+2+4+7+14+28 = 56 ✓

Example 2: Sum of Divisors of 36

Calculate σ(36).

Step 1: 36 = 2² × 3²

Step 2: For 2²: (2³ - 1) / (2 - 1) = 7/1 = 7
        For 3²: (3³ - 1) / (3 - 1) = 26/2 = 13

Step 3: σ(36) = 7 × 13 = 91
        s(36) = 91 - 36 = 55
        36 is ABUNDANT (55 > 36)

Verification: 1+2+3+4+6+9+12+18+36 = 91 ✓

5. More Divisor Sum Examples

σ(6) = 12: 6 = 2×3 → σ(6) = [(4-1)/1] × [(9-1)/2] = 3×4 = 12 (perfect!)

σ(12) = 28: 12 = 2²×3 → σ(12) = 7×4 = 28 (abundant, s(12)=16>12)

σ(10) = 18: 10 = 2×5 → σ(10) = 3×6 = 18 (deficient, s(10)=8<10)

σ(17) = 18: 17 is prime → σ(17) = (289-1)/(17-1) = 288/16 = 18 = 17+1

6. Sum of Proper Divisors s(n)

The aliquot sum s(n) is the sum of all divisors except the number itself:

Aliquot Sum

s(n) = σ(n) - n

The aliquot sum is used to classify numbers as perfect, abundant, or deficient.

s(12) = 28 - 12 = 16: Proper divisors: 1+2+3+4+6 = 16

s(28) = 56 - 28 = 28: Proper divisors: 1+2+4+7+14 = 28 (perfect!)

s(10) = 18 - 10 = 8: Proper divisors: 1+2+5 = 8

7. Perfect, Abundant, and Deficient Numbers

The aliquot sum s(n) classifies every positive integer into one of three categories:

Perfect Number: s(n) = n → σ(n) = 2n

Examples: 6, 28, 496, 8128

Abundant Number: s(n) > n → σ(n) > 2n

Examples: 12, 18, 20, 24, 30, 36

Deficient Number: s(n) < n → σ(n) < 2n

Examples: 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13 (most numbers)

All prime numbers are deficient: s(p) = 1.

8. The Sigma Function σₖ(n)

σ(n) = σ₁(n) is part of a family of divisor functions:

σ₀(n) = d(n): Counts the number of divisors (divisor count function).

σ₁(n) = σ(n): Sums the divisors (the standard sigma function).

σ₂(n): Sums the squares of divisors.

General σₖ(n): Sums the k-th powers of divisors.

All σₖ functions are multiplicative for coprime arguments.

9. Common Mistakes to Avoid

  • Confusing σ(n) with s(n): σ(n) includes n itself; s(n) = σ(n) - n excludes it. For perfect number checks, use s(n), not σ(n).
  • Forgetting the geometric series formula: For pᵉ, σ(pᵉ) = (pᵉ⁺¹ - 1)/(p - 1), not pᵉ + 1 (which only works for exponent 1).
  • Multiplying prime factors instead of their sigma values: σ(ab) = σ(a) × σ(b) when coprime, but σ(p×q) ≠ σ(p) × σ(q) if you don't use the formula correctly.
  • Thinking σ(n) = n + 1 for all non-prime numbers: This is only true for primes. Composite numbers have more divisors.
  • Forgetting that σ(1) = 1: The empty product in the formula gives 1.

10. Real-World Applications

  • Perfect Number Research: The search for odd perfect numbers is one of the oldest unsolved problems in mathematics — it depends entirely on understanding σ(n).
  • Cryptography: Divisor sums appear in the analysis of RSA parameters and the structure of multiplicative groups modulo n.
  • Aliquot Sequences: Iterating s(n) creates aliquot sequences — chains of numbers where each is the sum of proper divisors of the previous. The Catalan-Dickson conjecture concerns whether these sequences always terminate or become periodic.
  • Mathematics Competitions: Divisor sum problems are common in number theory olympiad questions.

11. Practice Problems with Solutions

Problem 1: Calculate σ(20).

Solution: 20 = 2²×5 → σ(20) = 7×6 = 42 (1+2+4+5+10+20=42 ✓)

Problem 2: Is 18 perfect, abundant, or deficient?

Solution: 18 = 2×3² → σ(18) = 3×13 = 39 → s(18) = 21 > 18 → ABUNDANT

Problem 3: Calculate σ(100).

Solution: 100 = 2²×5² → σ(100) = 7×31 = 217

Problem 4: If σ(n) = 2n, what can you conclude about n?

Solution: n is a perfect number (e.g., 6, 28, 496, 8128).

12. Tips for Mastering Divisor Sums

  • Memorize the formula for prime powers: σ(pᵉ) = (pᵉ⁺¹ - 1)/(p - 1).
  • For numbers with multiple distinct primes, multiply the σ values of each prime power.
  • Remember s(n) = σ(n) - n for proper divisor sums.
  • Perfect numbers satisfy σ(n) = 2n or equivalently s(n) = n.
  • Use prime factorization as your foundation — it unlocks all divisor functions.

13. Final Thoughts

The sum of divisors function σ(n) transforms the simple question "What are the divisors?" into a rich mathematical structure connecting prime factorization, perfect numbers, and the classification of all positive integers. From Euclid's ancient characterization of even perfect numbers to modern research on aliquot sequences and odd perfect numbers, σ(n) remains central to number theory.

Master the formula — for each prime power, compute the geometric series sum and multiply — and you'll be able to find divisor sums without listing divisors, even for large numbers. Use this calculator to verify your manual calculations, but practice applying the formula until it becomes second nature.