def E7A(n): primes = gen_Primes() p = 0 while n > 0: p = primes.next() n -= 1 return p
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
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