Moved problems till 56 to Python.

This commit is contained in:
2019-07-17 21:29:59 -04:00
parent 301033d17d
commit c624e6ac52
23 changed files with 417 additions and 23 deletions

View File

@@ -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)