def prime_factors(number): """Calculate the prime factors of a number Calculate the prime factors of a given natural NUMBER. Note that 1 is not a prime number, so it will not be included. """ result = pm.prime_factors(int(number)) click.echo(result)
def test_prime_factors_one(): expect = [] result = pm.prime_factors(1) assert result == expect
def test_prime_factors_large(): expect = [11, 9539, 894119] result = pm.prime_factors(93819012551) assert result == expect
def test_prime_factors_mixed(): expect = [5, 17, 23, 461] result = pm.prime_factors(901255) assert result == expect
def test_prime_factors_cube(): expect = [3, 3, 3] result = pm.prime_factors(27) assert result == expect
def test_prime_factors_square(): expect = [3, 3] result = pm.prime_factors(9) assert result == expect