xsot

PE 33

Feb 26th, 2011
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. from math import sqrt
  2. p,i,count=[2,3,5,7],10,0
  3. while count<12:
  4.   i+=1
  5.   if not any(i%j==0 for j in p[:int(sqrt(len(p)))]):
  6.     p+=[i]
  7.     x=1
  8.     for k in range(1,len(`i`)):
  9.       if any(m in ['0','4','6','8'] for m in `i`):x=0; break
  10.       if int(`i`[:k]) not in p: x=0; break
  11.       if int(`i`[k:]) not in p: x=0; break
  12.     if x==1:
  13.       print i
  14.       count+=1
Add Comment
Please, Sign In to add comment