You are viewing a single comment's thread. Return to all comments →
def primeCount(n): next_prime=2 is_prime = True number_of_factors=0 product=1 while True: for i in range(2, int(next_prime/2)+1): if next_prime % i==0: is_prime = False break if is_prime: product*=next_prime number_of_factors+=1 if product > n: number_of_factors-=1 break next_prime+=1 is_prime=True return number_of_factors
Seems like cookies are disabled on this browser, please enable them to open this website
Leonardo's Prime Factors
You are viewing a single comment's thread. Return to all comments →