Created
April 4, 2017 02:52
-
-
Save peroon/7e20cfb118399e8c0bc2f52431a13300 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def is_prime(n): | |
| if n == 2: return True | |
| if n < 2 or n % 2 == 0: return False | |
| return pow(2, n - 1, n) == 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment