def prime(x): i=int(x/2) flag=1 while i!=1: j=2 while i*j<=x: if i*j==x: flag=0 break else: j+=1 i=i-1 return flag