(f, factors, K)
return _sort_factors(result)
Determine multiplicities of factors using trial division.
Determine multiplicities of factors using trial division.
Determine multiplicities of factors using trial division .
def dup_trial_division(f, factors, K):
    """Determine multiplicities of factors using trial division. """
    result = []

    for factor in factors:
        k = 0

        while True:
            q, r = dup_div(f, factor, K)

            if not r:
                f, k = q, k + 1
            else:
                break

        result.append((factor, k))

    return _sort_factors(result)
def dup_trial_division ( f , factors , K ) : result = [ ] for factor in factors : k = 0 while True : q , r = dup_div ( f , factor , K ) if not r : f , k = q , k + 1 else : break result . append ( ( factor , k ) ) return _sort_factors ( result )