Factors of a number (#1493)

* Factors of a number

* Update factors.py

* Fix mypy issue in basic_maths.py

* Fix mypy error in perceptron.py

* def primes(max: int) -> List[int]:

* Update binomial_heap.py

* Add a space

* Remove a space

* Add a space
This commit is contained in:
himanshujain171
2019-10-30 04:24:31 +05:30
committed by Christian Clauss
parent f8e97aa597
commit 53ff735701
5 changed files with 105 additions and 95 deletions

View File

@ -67,10 +67,8 @@ def euler_phi(n: int) -> int:
>>> euler_phi(100)
40
"""
l = prime_factors(n)
l = set(l)
s = n
for x in l:
for x in set(prime_factors(n)):
s *= (x - 1) / x
return int(s)