jumboframe

primal test

Jun 7th, 2018
94
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2. i=3
  3.  
  4.  
  5. if (n % 2 == 0) or (n % 3 == 0) or (n <= 1):
  6.     print ("Not prime")
  7.     exit(0)
  8.  
  9. while i * i < n:
  10.     if ( n % i == 0 ) or (n % ( i+2 ) == 0):
  11.         print ("Not prime")
  12.         exit (0)
  13.     else:
  14.         i += 6
  15.  
  16. print ("Prime")
RAW Paste Data