MCPcopy Index your code
hub / github.com/geekcomputers/Python / is_square_free

Function is_square_free

MobiusFunction.py:1–9  ·  view source on GitHub ↗

This functions takes a list of prime factors as input. returns True if the factors are square free.

(factors)

Source from the content-addressed store, hash-verified

1def is_square_free(factors):
2 """
3 This functions takes a list of prime factors as input.
4 returns True if the factors are square free.
5 """
6 for i in factors:
7 if factors.count(i) > 1:
8 return False
9 return True
10
11
12def prime_factors(n):

Callers 1

mobius_functionFunction · 0.85

Calls 1

countMethod · 0.80

Tested by

no test coverage detected