Skip to content

Commit 88c438f

Browse files
Update sol1.py
1 parent 4b7893e commit 88c438f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

project_euler/problem_095/sol1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
- Iterate over found some factors to find longest chain
2929
"""
3030

31-
from numpy import sqrt
31+
from math import isqrt
3232

3333

3434
def sum_primes(factor_d, num):
@@ -58,7 +58,7 @@ def generate_primes(n: int):
5858
"""
5959
primes = [True] * (n + 1)
6060
primes[0] = primes[1] = False
61-
for i in range(2, int(sqrt(n + 1)) + 1):
61+
for i in range(2, isqrt(n) + 1):
6262
if primes[i]:
6363
j = i * i
6464
while j <= n:

0 commit comments

Comments
 (0)