MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / solution

Function solution

project_euler/problem_012/sol2.py:46–53  ·  view source on GitHub ↗

Returns the value of the first triangle number to have over five hundred divisors. >>> solution() 76576500

()

Source from the content-addressed store, hash-verified

44
45
46def solution():
47 """Returns the value of the first triangle number to have over five hundred
48 divisors.
49
50 >>> solution()
51 76576500
52 """
53 return next(i for i in triangle_number_generator() if count_divisors(i) > 500)
54
55
56if __name__ == "__main__":

Callers 1

sol2.pyFile · 0.70

Calls 2

count_divisorsFunction · 0.70

Tested by

no test coverage detected