Skip to content

Instantly share code, notes, and snippets.

@Peilonrayz
Created May 17, 2018 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Peilonrayz/c45f01f4695cd451275dfad5f44883a0 to your computer and use it in GitHub Desktop.
Save Peilonrayz/c45f01f4695cd451275dfad5f44883a0 to your computer and use it in GitHub Desktop.
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