MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / count_divisors

Function count_divisors

project_euler/problem_12/sol2.py:5–6  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

3 yield n*(n+1)//2
4
5def count_divisors(n):
6 return sum([2 for i in range(1,int(n**0.5)+1) if n%i==0 and i*i != n])
7
8print(next(i for i in triangle_number_generator() if count_divisors(i) > 500))

Callers 1

sol2.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected