Guest User

#halfthelines

a guest
Feb 15th, 2016
71
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53]
  2.  
  3. def isPrime(x,k):
  4.     sum = 0
  5.     for y in xrange(0,len(str(x))):
  6.         sum += int(str(x)[y])
  7.     for z in xrange(0,len(primes)):
  8.             if sum == primes[z]:
  9.                 p = primes[z]
  10.                 if k == 1: return p
  11.                 else: return x
  12.  
  13. for x in xrange(10,1000000):
  14.     if x % 2 == 0 and x % 10 != 0:
  15.         if isPrime(x,1) != None:
  16.             print isPrime(x,0)
RAW Paste Data