Created
September 10, 2013 13:22
-
-
Save SahilC/6509311 to your computer and use it in GitHub Desktop.
Strangely awesome way to find prime numbers
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 prime(n): | |
for i in range(3,n): | |
if 2**(i-1)%i==1: | |
print i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment