def isPrime(n):
if n == 1:
return False
for ele in range(2,int(n**0.5)+1):
if n % ele == 0:
return False
return True
def the_list():
L = []
for num in range(1,1000000):
if isPrime(num) is True:
L.append(num)
return L
def add_primes(primes):
counter = 0
in_counter = 0
sum = 0
L = []
while sum < 1000000:
sum += primes[counter]
if isPrime(sum):
L.append(sum)
in_counter += 1
counter += 1
if L[-1] < 1000000:
return L[-1], in_counter
elif L[-1] > 1000000:
print "****"
return L[-2], in_counter
def main():
primes = the_list()
main_counter = 0
x = add_primes(primes)
print x[0], x[1]
if x[0] > main_counter:
main_counter = x[0]
return main_counter
print main()
if n == 1:
return False
for ele in range(2,int(n**0.5)+1):
if n % ele == 0:
return False
return True
def the_list():
L = []
for num in range(1,1000000):
if isPrime(num) is True:
L.append(num)
return L
def add_primes(primes):
counter = 0
in_counter = 0
sum = 0
L = []
while sum < 1000000:
sum += primes[counter]
if isPrime(sum):
L.append(sum)
in_counter += 1
counter += 1
if L[-1] < 1000000:
return L[-1], in_counter
elif L[-1] > 1000000:
print "****"
return L[-2], in_counter
def main():
primes = the_list()
main_counter = 0
x = add_primes(primes)
print x[0], x[1]
if x[0] > main_counter:
main_counter = x[0]
return main_counter
print main()
![](http://g.hiphotos.bdimg.com/album/s%3D1600%3Bq%3D90/sign=f4f5936a99504fc2a65fb403d5eddc60/4b90f603738da977e2c99949b251f8198718e3ea.jpg?v=tbs)