Exemple #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
Exemple #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
Exemple #3
0
def solution():
    number = 1
    counter = 2  # two is prime
    while (counter <= LIMIT):
        number += 2
        if is_prime(number):
            counter += 1
    return number
Exemple #4
0
def solution():
    total_sum = 0
    for n in xrange(2, LIMIT):
        if is_prime(n):
            total_sum += n
    return total_sum
Exemple #5
0
def solution():
    total_sum = 0
    for n in xrange(2, LIMIT):
        if is_prime(n):
            total_sum += n
    return total_sum