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
from mathe import prime sum = 0 max = 2000000 for num in range(1, max+1): if prime(num): sum += num print sum
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