Skip to content

Commit 61694de

Browse files
authored
Create euler_project_3.py
1 parent 71bffe8 commit 61694de

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

PYTHON/euler_project_3.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import math
2+
3+
a = 600851475143
4+
def isprime(x):
5+
for i in range(2,math.floor(math.sqrt(x))):
6+
if x%i == 0:
7+
return False
8+
return True
9+
10+
t = math.floor(math.sqrt(a));
11+
while not(isprime(t)) or a%t != 0:
12+
t-=1
13+
14+
print(t)

0 commit comments

Comments
 (0)