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