Skip to content

Instantly share code, notes, and snippets.

@Ahmed-Fawzy
Created May 4, 2014 09:35
Show Gist options
  • Save Ahmed-Fawzy/4dc3d0a8dc178503e2df to your computer and use it in GitHub Desktop.
Save Ahmed-Fawzy/4dc3d0a8dc178503e2df to your computer and use it in GitHub Desktop.
project euler problem12 - this script takes too long time to solve problem
#!/usr/bin/python
#this script takes long time to get the first number that has 500 divisors
number = 0
for i in range(1,10000):
number += i
s = 0
for x in range(1,number+1):
if number % x == 0 :
s += 1
if s == 500 :
print number ,'is the first number that has 500 divisors'
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment