MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / solution

Function solution

project_euler/problem_077/sol1.py:64–78  ·  view source on GitHub ↗

Return the smallest integer that can be written as the sum of primes in over m unique ways. >>> solution(4) 10 >>> solution(500) 45 >>> solution(1000) 53

(number_unique_partitions: int = 5000)

Source from the content-addressed store, hash-verified

62
63
64def solution(number_unique_partitions: int = 5000) -> int | None:
65 """
66 Return the smallest integer that can be written as the sum of primes in over
67 m unique ways.
68 >>> solution(4)
69 10
70 >>> solution(500)
71 45
72 >>> solution(1000)
73 53
74 """
75 for number_to_partition in range(1, NUM_PRIMES):
76 if len(partition(number_to_partition)) > number_unique_partitions:
77 return number_to_partition
78 return None
79
80
81if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls 1

partitionFunction · 0.70

Tested by

no test coverage detected