diff --git a/other/finding_primes.py b/other/finding_primes.py index 035a14f4a335..9b95640f20fd 100644 --- a/other/finding_primes.py +++ b/other/finding_primes.py @@ -5,9 +5,10 @@ from __future__ import print_function -from math import sqrt +from math import sqrt, ceil + def SOE(n): - check = round(sqrt(n)) #Need not check for multiples past the square root of n + check = int(ceil(sqrt(n))) #Need not check for multiples past the square root of n sieve = [False if i <2 else True for i in range(n+1)] #Set every index to False except for index 0 and 1