Created
May 4, 2014 09:35
-
-
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
This file contains hidden or 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
#!/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