# Finding sum of factors of a number using prime factorization

Given a number, there is an algorithm described here to find it's sum and number of factors. For example, let us take the number $1225$ :

It's factors are $1, 5, 7, 25, 35, 49, 175, 245, 1225$ and the sum of factors are $1767$.

A simple algorithm that is described to find the sum of the factors is using prime factorization.

$1225 = 5^2 \cdot 7^2$, therefore the sum of factors is $(1+5+25)(1+7+49) = 1767$

But this logic does not work for the number $2450$. Please check if it's working for $2450$

Edit : Sorry it works for $2450$. I made some mistake in calculation.

• $1767=3\cdot 19\cdot 31$ and $5^27^2=1225$ Jun 26, 2012 at 9:59
• $2450=2.5^2.7^2$.therefore,$Sum=(1+2)(1+5+25)(1+7+49)=5301$.Isn't it the right sum?(Because i know the formula is correct).
– Aang
Jun 26, 2012 at 10:03

Your approach works fine: $$2450=2\cdot 5^2\cdot 7^2$$, therefore the sum of divisor is $$(1+2)(1+5+25)(1+7+49)=5301=3\cdot 1767.$$

You are looking for the Formula For Sum Of Divisors, from there:

Each of these sums is a geometric series; hence we may use the formula for sum of a geometric series to conclude $$\sum_{d|n}d = \prod_{i=1}^k \frac{p_i^{m_i+1}-1}{p_i-1}$$

Solving for $1225 = 5^2 × 7^2$

Sum of divisors = $(a^{p+1} – 1)/(a – 1) × (b^{q+1} – 1)/(b – 1)$
Here $a = 5$, $b = 7$ prime factors
$p = 2$ and $q = 2$
Sum of divisors = $(5^3 – 1)/(5 – 1) × (7^3 – 1)/(7 – 1)$
= $(124/4) × (342/6)$
= $(31 × 57)$
= $1767$

$2450=2\cdot5^2\cdot7^2$, so the algorithm gives

$$(1+2)(1+5+25)(1+7+49)=3\cdot31\cdot57=5301\;.$$

The divisors of $2450$ are $1,2,5,7,10,14,25,35,49,50,70,98,175,245,350,490,1225$, and $2450$, whose sum is indeed $5301$.

It’s not difficult to prove that the algorithm works, so if you thought that it failed, you made a mistake somewhere in your calculations; my guess would be that you missed a divisor of $2450$.

If a number $N=(a^x)(b^y)(c^z)$, where $a,b$ and $c$ are prime numbers, sum of it's factor is $S= [(a^{x+1}-1)/(a-1)][(b^{y+1}-1)/(b-1)][(c^{z+1}-1)/(c-1)]$

Eg. $12=[(2^{2+1}-1)/(2-1)][{(3^{1+1}-1)}/(3-1)]=28$

Sum of factors of $2450$

The Factors are $2, 5^2, 7^2$.

Sum of the factors $= ( 2^0 + 2^1 ) × ( 5^0 + 5^1+ 5^2)×( 7^0 + 7^1+ 7^2) = 5301$