Moved problems till 56 to Python.
This commit is contained in:
@@ -1,8 +1,19 @@
|
||||
import math
|
||||
|
||||
|
||||
def combinations_naiv(n, r):
|
||||
return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))
|
||||
|
||||
|
||||
def euler_053():
|
||||
return 0
|
||||
count = 0
|
||||
for n in range(1, 101):
|
||||
for r in range(1, n + 1):
|
||||
if combinations_naiv(n, r) > 10**6:
|
||||
count += 1
|
||||
return count
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("e053.py: " + str(euler_053()))
|
||||
assert(euler_053() == 0)
|
||||
assert(euler_053() == 4075)
|
||||
|
||||
Reference in New Issue
Block a user