Moved 20 to 26 to Python.

This commit is contained in:
2019-07-15 22:11:49 -04:00
parent 0ab214633e
commit f76b36c8d3
10 changed files with 194 additions and 174 deletions

View File

@@ -8,6 +8,8 @@ except ModuleNotFoundError:
def prime_factors(n):
"""
Returns a list of prime factors for n.
:param n: number for which prime factors should be returned
"""
# TODO: Look into using a prime wheel instead.
@@ -30,10 +32,12 @@ def prime_factors(n):
def prime_factors_count(n):
"""
Returns a dictionay of primes where each key is a prime
and the value how many times that prime is part of the factor of n.
:param n: numober for which prime factor counts are returned
:returns: a dict where they key is a prime vactor and the value
the count of how of that value occurs
:returns: a dict where they key is a prime and the value
the count of how often that value occurs
"""
return get_item_counts(prime_factors(n))