diff --git a/DIRECTORY.md b/DIRECTORY.md index 0c00d5ca7f70..eba63e17eaff 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -449,6 +449,7 @@ * [Find Min Recursion](https://github.com/TheAlgorithms/Python/blob/master/maths/find_min_recursion.py) * [Floor](https://github.com/TheAlgorithms/Python/blob/master/maths/floor.py) * [Gamma](https://github.com/TheAlgorithms/Python/blob/master/maths/gamma.py) + * [Gamma Recursive](https://github.com/TheAlgorithms/Python/blob/master/maths/gamma_recursive.py) * [Gaussian](https://github.com/TheAlgorithms/Python/blob/master/maths/gaussian.py) * [Greatest Common Divisor](https://github.com/TheAlgorithms/Python/blob/master/maths/greatest_common_divisor.py) * [Greedy Coin Change](https://github.com/TheAlgorithms/Python/blob/master/maths/greedy_coin_change.py) diff --git a/project_euler/problem_003/sol1.py b/project_euler/problem_003/sol1.py index 3441dbf9e0b3..1f329984203a 100644 --- a/project_euler/problem_003/sol1.py +++ b/project_euler/problem_003/sol1.py @@ -92,8 +92,8 @@ def solution(n: int = 600851475143) -> int: return n for i in range(3, int(math.sqrt(n)) + 1, 2): if n % i == 0: - if isprime(n / i): - max_number = n / i + if isprime(n // i): + max_number = n // i break elif isprime(i): max_number = i diff --git a/project_euler/problem_003/sol3.py b/project_euler/problem_003/sol3.py index bc6f1d2f61ca..e13a0eb74ec1 100644 --- a/project_euler/problem_003/sol3.py +++ b/project_euler/problem_003/sol3.py @@ -57,7 +57,7 @@ def solution(n: int = 600851475143) -> int: i += 1 ans = i while n % i == 0: - n = n / i + n = n // i i += 1 return int(ans)