arithmetic
Number of Divisors and Sum of Divisors from Prime Factorization
intermediate
High weightage
CAT
XAT
NMAT
SNAP
CMAT
IIFT
MAT
If\; n=\prod_{i=1}^{k} p_{i}^{\alpha_{i}}\;\text{(prime factorization)},\; then\; d(n)=\prod_{i=1}^{k} (\alpha_{i}+1)\quad\text{and}\quad \sigma(n)=\prod_{i=1}^{k} \frac{p_{i}^{\alpha_{i}+1}-1}{p_{i}-1}Given integer n>1 with prime factorization n=where are distinct primes and are integers, d(n) counts positive divisors and n) is the sum of positive divisors. Variables: primes), exponent integers), k (number of distinct prime factors). d(n) multiplies (because each prime exponent can be chosen from 0 to inclusive; algebraically enumerate possibilities for each prime and multiply by independence. n) sums geometric series for each prime factor: divisors include so product of those sums gives total sum. Edge cases: n=1 has d(1)=1 and by convention; formula requires prime factorization and integer exponents; non-integer n invalid. Useful for detecting perfect numbers (n)=2n) and parity of divisor count (d(n) odd iff n is a perfect square).