parent
73239e1c23
commit
99b7386d93
@ -0,0 +1,23 @@
|
||||
import math
|
||||
#find the first triangle number with over five hundred divisors
|
||||
|
||||
|
||||
def countDivisors(number):
|
||||
count = 0
|
||||
for i in range (1, int(math.sqrt(number))):
|
||||
if number % i == 0:
|
||||
count += 1
|
||||
return count
|
||||
|
||||
running = True
|
||||
counter = 1
|
||||
while(running):
|
||||
sum = 0
|
||||
for i in range(0, counter + 1):
|
||||
sum += i
|
||||
if countDivisors(sum) > 400:
|
||||
print(counter)
|
||||
running = False
|
||||
counter += 1
|
||||
|
||||
print(counter)
|
Loading…
Reference in new issue