Skip to content
Prev Previous commit
Next Next commit
Remove parameter from solution()
  • Loading branch information
peteryao7 committed Oct 8, 2020
commit ca5da045c9b4223e1dc7b619a850f9f26e4bac79
5 changes: 3 additions & 2 deletions project_euler/problem_70/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""


def solution(max: int) -> int:
def solution() -> int:
"""
This is essentially brute force. Calculate all totients up to 10^7 and
find the minimum ratio of n/φ(n) that way. To minimize the ratio, we want
Expand All @@ -30,6 +30,7 @@ def solution(max: int) -> int:

min_num = 1 # i
min_den = 0 # φ(i)
max = 10000000
totients = get_totients(max + 1)

for i in range(2, max + 1):
Expand Down Expand Up @@ -88,4 +89,4 @@ def has_same_digits(num1: int, num2: int) -> bool:


if __name__ == "__main__":
print(solution(10000000))
print(solution())