-
galois.trial_division(n: int, B: int | None =
None
) tuple[list[int], list[int], int] Finds all the prime factors
of for .The trial division factorization will find all prime factors
such that factors as where is a residual factor (which may be composite).- Parameters:¶
- Returns:¶
The discovered prime factors
.The corresponding prime exponents
.The residual factor
.
See also
Examples
In [1]: n = 2**4 * 17**3 * 113 * 15013 In [2]: galois.trial_division(n) Out[2]: ([2, 17, 113, 15013], [4, 3, 1, 1], 1) In [3]: galois.trial_division(n, B=500) Out[3]: ([2, 17, 113], [4, 3, 1], 15013) In [4]: galois.trial_division(n, B=100) Out[4]: ([2, 17], [4, 3], 1696469)