You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, by looking quickly to the source, it is obvious that the algorithm is false. The most basic fix is to add n % 5 == 0 in line 11, but i bet i would not be sufficient.
The following code seems to work better:
if n <= 1: return False
for i in range(2, 1 + int(math.sqrt(n))):
if n % i == 0: return False
return True
the prime_test function returns true for 35, while 35 is not a prime.
The text was updated successfully, but these errors were encountered: