Skip to content

Instantly share code, notes, and snippets.

@Peilonrayz Peilonrayz/pe12.py Secret
Created May 17, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.