Ejemplo n.º 1
0
def solution2():
    total = 5
    counter = 5
    while counter <= LIMIT:
        if is_prime(counter):
            total += counter
        counter += 2
        if counter <= LIMIT and is_prime(counter):
            total += counter
        counter += 4

    return total
Ejemplo n.º 2
0
def solution2():
    total = 5
    counter = 5
    while counter <= LIMIT:
        if is_prime(counter):
            total += counter
        counter += 2
        if counter <= LIMIT and is_prime(counter):
            total += counter
        counter += 4

    return total
Ejemplo n.º 3
0
def solution():
    number = 1
    counter = 2  # two is prime
    while (counter <= LIMIT):
        number += 2
        if is_prime(number):
            counter += 1
    return number
Ejemplo n.º 4
0
def solution():
    total_sum = 0
    for n in xrange(2, LIMIT):
        if is_prime(n):
            total_sum += n
    return total_sum
Ejemplo n.º 5
0
def solution():
    total_sum = 0
    for n in xrange(2, LIMIT):
        if is_prime(n):
            total_sum += n
    return total_sum