예제 #1
0
파일: e7.py 프로젝트: athuras/Projects
def E7A(n):
    primes = gen_Primes()
    p = 0
    while n > 0:
        p = primes.next()
        n -= 1
    return p
예제 #2
0
파일: e10.py 프로젝트: athuras/Projects
def E10(n):
    """Return the sum of all primes below n"""
    s, primes = 0, gen_Primes()
    for p in primes:
        if p < n:
            s += p
        else:
            return s
예제 #3
0
파일: e3.py 프로젝트: athuras/Projects
def E3B(n):
    '''Find the largest Prime Factor of n'''
    ps = gen_Primes()
    p = 0
    while n > 1:
        p = ps.next()
        if n % p == 0:
            while n % p == 0:
                n /= p
    return p