Can it be prime???#3

Find the sum of all prime divisors of 1027352670781867


The answer is 23106.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Using Python to solve,

As you can see, the number 2 is the accumulator register that we shall define as any number that can be divided by 2 or any number larger (other than it self) is no longer prime... Therefore, we use the modulo function and the rest can speak for itself!

Brock Brown
Jan 3, 2015
1
2
3
4
5
6
7
8
9
divisors = set()
num = 1027352670781867
i = 2
while i <= num:
    while num % i == 0:
        divisors.add(i)
        num = num / i
    i += 1
print "Answer:", sum(divisors)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...