示例#1
0
def prime_length(a, b):
    length = 0
    for x in itertools.count(0):
        if prime(func(x, a, b)):
            length += 1
        else:
            break

    return length
示例#2
0
from mathe import prime

sum = 0
max = 2000000
for num in range(1, max+1):
    if prime(num):
        sum += num

print sum
示例#3
0
from mathe import prime

target = 10001
lastprime = 2
num = 1
test = 3

while(num < target):
    if(prime(test)):
        num += 1
        lastprime = test
    test += 2

print lastprime