-
-
Save Peilonrayz/c45f01f4695cd451275dfad5f44883a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def euler_12(num): | |
n = 0 | |
for i in range(1,num): | |
n += i | |
list= [] | |
for j in range(1, int(n**0.5) + 1): | |
if (n % j) == 0: | |
list.append(j) | |
if len(list) == 500: | |
print(n+i) | |
break | |
list.append(n // j) | |
if len(list) == 500: | |
print(n+i) | |
break | |
euler_12(12376) | |
# 76576500 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment