Skip to content

Commit

Permalink
Merge pull request #13294 from jjallan/patch-1
Browse files Browse the repository at this point in the history
Removed some redundant checks from isprime
  • Loading branch information
smichr committed Sep 11, 2017
2 parents 94494ed + 71ff7c7 commit 5a5d97d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions sympy/ntheory/primetest.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,7 @@ def isprime(n):
if n < 2809:
return True
if n <= 23001:
return pow(2, n, n) == 2 and n not in [341, 561, 645, 1105, 1387, 1729,
1905, 2047, 2465, 2701, 2821,
3277, 4033, 4369, 4371, 4681,
5461, 6601, 7957, 8321, 8481,
8911, 10261, 10585, 11305,
12801, 13741, 13747, 13981,
14491, 15709, 15841, 16705,
18705, 18721, 19951, 23001]
return pow(2, n, n) == 2 and n not in [7957, 8321, 13747, 18721, 19951]

# bisection search on the sieve if the sieve is large enough
from sympy.ntheory.generate import sieve as s
Expand Down

0 comments on commit 5a5d97d

Please sign in to comment.