-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblem53.py
More file actions
42 lines (26 loc) · 792 Bytes
/
Copy pathproblem53.py
File metadata and controls
42 lines (26 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import time
import math
from mymodule import calculate_time
from mymodule import is_prime
#########################################################################3
def combinatorics(n, r):
if r > n:
return None
return int(math.factorial(n)/(math.factorial(r)*math.factorial(n - r)))
def test():
print(combinatorics(23,10))
#########################################################################3
@calculate_time
def main():
upper = 100
ground_limit = 1000000
count = 0
for n in range(23, upper + 1):
for r in range(0, n):
if combinatorics(n, r) > ground_limit:
count += 1
print(count)
return 0
if __name__ == "__main__":
main()
# test()