Ejemplo n.º 1
0
def factor(number):
    factors = list([])
    for i in listprimes(sqrt(number)+1):
        #print(number)
        if (number % i == 0):
            factors.append(i)
            factors.extend(factor(number/i))
            return factors
    if number != 1:
        factors.append(number)
    return factors
Ejemplo n.º 2
0
#! /usr/bin/python2

import listprime

total = 2
for i in listprime.listprimes(2000000):
	total += i

print total