Exemplo n.º 1
0
def sum_of_primes_under(n):
    start = 2
    total = 0
    while start < n:
        total += start
        start = get_next_prime(start)
    return total
Exemplo n.º 2
0
def nth_prime(n):
    start = 0
    for i in xrange(n):
        prime = mathtools.get_next_prime(start)
        start = prime
    return prime