Sum of factors of multiplication of different numbers

468 Views Asked by At

Given $N$ numbers $n_i$ such that $\forall i \le N, n_i$ $\le10^9$, is there a method to calculate the sum of divisors of their product?

For example, given $\{11,15,17\}$ their product would is $2805$. The divisors of 2805 are $\{1,3,5,11,15,17,33,51,55,85,165,187,255,561,935,2805\}$, and the sum of those divisors (which is what I'm looking for) is $5184$.

I am a programmer and looking to implement this equation in my code. Tackling it with loops does work, but on large numbers it takes about 5 minutes to give a result!

1

There are 1 best solutions below

0
On

If you have access to MatLab, you could use this divisor(n) function by Yash. From there, just call sum to get your total. For example:

>> sum(divisor(2805))
ans =
  5184